Skip to content
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

Merged
merged 3 commits into from
Feb 18, 2020

Conversation

dhimmel
Copy link
Member

@dhimmel dhimmel commented Feb 18, 2020

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

@@ -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
Copy link
Member Author

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

@@ -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."
Copy link
Member Author

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

@dhimmel
Copy link
Member Author

dhimmel commented Feb 18, 2020

@agitter this is good to go on my end. If looks good to you, feel free to merge.

Copy link
Member

@agitter agitter left a 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?

@dhimmel
Copy link
Member Author

dhimmel commented Feb 18, 2020

Yep your description is spot on.

@dhimmel dhimmel merged commit c25f8b8 into manubot:master Feb 18, 2020
@dhimmel dhimmel deleted the branchless-setup branch February 18, 2020 20:31
ploegieku added a commit to ploegieku/2023-functional-homology-paper that referenced this pull request Aug 6, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants