Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Fix publish script #103

Merged

Conversation

therobinkim
Copy link
Contributor

Fixes #102.

This PR requires a little work to test as the changes in the PR actually rely on the current status of hyperledger:staging (and until this PR is merged... the changes won't be on hyperledger:staging).

So, I've tested it out on my own fork! Here are the commits that the script produced:

We will be able to more accurately test this PR once it's been merged (which is a bit unfortunate).

@therobinkim therobinkim self-assigned this Jun 28, 2018
Previously, the publish script would be unable to `git checkout`
away from the `staging` branch after `bin/problemify` was run.

This commit fixes the issue by copying the entire directory
(minus `.git/` and `node_modules/`) into `tmp/`.

As the `tmp/` directory is not tracked by `git`, we are able to
safely `git checkout` to `master` (or `solution`) without any
errors.

This commit also changes how the latest work is pulled from
the upstream branches. Rather than using `git pull`, the script
now does a `git checkout` on the upstream branches, then forces
the local reference to the branch to match wherever the upstream
branch is pointing to.

This safeguards against scenarios where the local `staging`
branch has more work than `upstream/staging`.

Signed-off-by: Robin Kim <therobinkim@gmail.com>
@@ -19,28 +19,42 @@ ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../"
CURR_BRANCH="$( git rev-parse --abbrev-ref HEAD )"

# Pull new staging code
# when testing, use `git checkout origin/staging`
Copy link
Contributor

@delventhalz delventhalz Jul 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should include these comments. In theory it should be tested, and if someone can't figure out to switch it to origin when they need to test it, they probably shouldn't be running this script.

@delventhalz delventhalz merged commit 57f2f08 into hyperledger-archives:staging Jul 12, 2018
@therobinkim therobinkim deleted the fix-publish-script branch August 16, 2018 08:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants