chikathreesix/jekyll-gh-pages

Add an option to specify a different repo to push gh-pages

Closed this issue · 10 comments

Our CI clones in read-only so we need to push to a different URL with some credentials. It could read from the environment variable and fallback to the current one

Thanks for the issue, that would be cool!
So far the options you want to specify are url for the repository and branch_name aren't they?

I would send a pr but I'm afraid Ruby isn't on my list of languages

okay I will work on it! :)

Released v0.1.0
Now you can specify REMOTE_NAME and BRANCH_NAME as follow.
You might not want to have a lot of config files so I made it by specifying ENV variables.

rake prepare REMOTE_NAME=test_remote BRANCH_NAME=test_branch
rake deploy REMOTE_NAME=test_remote BRANCH_NAME=test_branch

You need to rake prepare first, if you want to specify another repo or branch.

@chikathreesix thanks for this. However I seem to not be using it correctly. I define the remote name via an environment variable and it doesn't seem to work

I figured out why it's not working, it's not the name of the remote I need to change but the URL of the repo. Could it checkout for a REMOTE_URL first and if it doesn't find it it uses this line

https://github.com/chikathreesix/jekyll-gh-pages/blob/master/lib/jekyll-gh-pages/tasks/gh-pages.rake#L16

Can you assign the URL to a new remote name by doing this?

git remote add remote_name repo_url

And then specify the remote_name in the rake tasks?

rake prepare REMOTE_NAME=remote_name
rake deploy REMOTE_NAME=remote_name

I guess I could do it that way it's true!

Great! Thanks for reporting the issue!