-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify setup by creating branches later #314
Conversation
@@ -50,18 +50,11 @@ Next you must clone `manubot/rootstock` and configure its branches and remotes: | |||
|
|||
```sh | |||
# Clone manubot/rootstock | |||
git clone https://github.com/manubot/rootstock.git $REPO | |||
git clone --single-branch https://github.com/manubot/rootstock.git $REPO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the effect of this can be viewed by doing git branch --all
.
Before --single-branch
(base) ~/D/r/rootstock-branchless-setup ❯❯❯ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/gh-pages
remotes/origin/master
remotes/origin/output
After --single-branch
(base) ~/D/r/rootstock-branchless-setup ❯❯❯ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
677f4e0
to
79a9ad8
Compare
@@ -64,7 +64,8 @@ fi | |||
# Fetch and create gh-pages and output branches | |||
# Travis does a shallow and single branch git clone | |||
git remote set-branches --add origin gh-pages output | |||
git fetch origin gh-pages:gh-pages output:output | |||
git fetch origin gh-pages:gh-pages output:output || \ | |||
echo >&2 "[INFO] could not fetch gh-pages or output from origin." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally am starting to understand bash conditionals haha. This article helped https://www.linuxjournal.com/content/understanding-bash-elements-programming
@agitter this is good to go on my end. If looks good to you, feel free to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but can you confirm I'm following the new strategy correctly. For a new manuscript, the first deploy event won't be able to fetch gh-pages
and output
because they were not pushed during setup. However, the deploy script now ignores the error on fetch and continues with the deployment, creating those branches at the first deployment. All subsequent deployments work as they did previously.
Is that right?
Yep your description is spot on. |
merges manubot/rootstock#314 * Simplify setup by creating branches later For a new manuscript, the first deploy event won't be able to fetch gh-pages and output because they were not pushed during setup. However, the deploy script now ignores the error on fetch and continues with the deployment, creating those branches at the first deployment. All subsequent deployments work as they did previously. * SETUP: Update with how to workaround GITHUB_TOKEN not triggering Pages builds.
Prototyped in https://github.com/dhimmel/rootstock-branchless-setup
BTW I had some trouble initially having GITHUB_TOKEN deploy in https://github.com/dhimmel/rootstock-branchless-setup but I played around in settings and now it works I think. Must look into more