-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
# remember initial branch | ||
dev_branch=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
# replace possible "/" with "-" |
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.
Could you include a comment why it is done? Gitlab does not like /
in branch names?
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 is not because of gitlab. The reason is docker. It uses git tag for tagging the image so if there's a /
symbol docker thinks that it's actually a path. but not part of the tag name.
deploy-stg.sh
Outdated
stg_branch="stg-v0.0.${timestamp}-${dev_branch_sanitized}" | ||
|
||
git checkout -b "$stg_branch" | ||
git push origin "$stg_branch" |
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.
Consider doing:
git push origin HEAD:"$stg_branch"
Then you could simplify the script by removing the git checkouts because a local branch is not needed then.
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.
Oh, I didn't know that!
deploy-stg.sh
Outdated
git push origin --delete "$stg_branch" | ||
|
||
# get back to initial branch | ||
git checkout "$dev_branch" |
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.
Not needed now.
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.
right, thanks!
Testing:
cumulus: https://github.com/paritytech-stg/cumulus/pull/2