-
Notifications
You must be signed in to change notification settings - Fork 165
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
GH-1995 push release branch and automate PR creation #1997
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,12 @@ increment_version() { | |
echo "$v" | perl -pe s/$rgx.*$'/${1}'`printf %0${#val}s $(($val+1))`/ | ||
} | ||
|
||
echo "" | ||
echo "The release script requires several external command line tools:" | ||
echo " - git" | ||
echo " - mvn" | ||
echo " - hub (https://hub.github.com/)" | ||
echo " - xmlllint (http://xmlsoft.org/xmllint.html)" | ||
|
||
echo "" | ||
echo "This script will stop if an unhandled error occurs"; | ||
|
@@ -106,11 +112,12 @@ git commit -s -a -m "release ${MVN_VERSION_RELEASE}" | |
git tag "${MVN_VERSION_RELEASE}" | ||
|
||
echo ""; | ||
echo "Pushing tag to github" | ||
echo "Pushing release branch to github" | ||
read -n 1 -s -r -p "Press any key to continue (ctrl+c to cancel)"; printf "\n\n"; | ||
|
||
# push tag (only tag, not branch) | ||
git push origin "${MVN_VERSION_RELEASE}" | ||
# push release branch and tag | ||
git push -u origin ${BRANCH} | ||
git push "${MVN_VERSION_RELEASE}" | ||
|
||
echo ""; | ||
echo "You need to tell jenkins to start the release process." | ||
|
@@ -119,10 +126,7 @@ echo "Log in, then choose 'Build with Parameters' and type in ${MVN_VERSION_RELE | |
read -n 1 -s -r -p "Press any key to continue (ctrl+c to cancel)"; printf "\n\n"; | ||
|
||
# Cleanup | ||
git checkout master | ||
mvn clean | ||
git branch --delete --force "${BRANCH}" &>/dev/null | ||
|
||
|
||
# Set a new SNAPSHOT version | ||
echo ""; | ||
|
@@ -143,6 +147,14 @@ git commit -s -a -m "next development iteration: ${MVN_NEXT_SNAPSHOT_VERSION}" | |
echo "Pushing the new version to github" | ||
git push | ||
|
||
echo ""; | ||
echo "About to create PR" | ||
read -n 1 -s -r -p "Press any key to continue (ctrl+c to cancel)"; printf "\n\n"; | ||
echo ""; | ||
|
||
echo "Creating pull request to merge release branch back into master" | ||
hub pull-request -f -m "next development iteration: ${MVN_NEXT_SNAPSHOT_VERSION}" -b origin:master | ||
|
||
echo ""; | ||
echo "Preparing a merge-branch to merge into develop" | ||
read -n 1 -s -r -p "Press any key to continue (ctrl+c to cancel)"; printf "\n\n"; | ||
|
@@ -153,7 +165,7 @@ git pull | |
|
||
MVN_VERSION_DEVELOP=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml) | ||
|
||
git checkout master | ||
git checkout ${BRANCH} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn’t this the branch we are on already? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good point |
||
git checkout -b "merge_master_into_develop_after_release_${MVN_VERSION_RELEASE}" | ||
mvn versions:set -DnewVersion=${MVN_VERSION_DEVELOP} | ||
|
@@ -162,12 +174,9 @@ mvn -P compliance versions:commit | |
git commit -s -a -m "set correct version" | ||
git push --set-upstream origin "merge_master_into_develop_after_release_${MVN_VERSION_RELEASE}" | ||
|
||
|
||
echo "Go to Github and create a new PR" | ||
echo "You want to merge 'merge_master_into_develop_after_release_${MVN_VERSION_RELEASE}' into develop" | ||
echo "You can use this link: https://github.com/eclipse/rdf4j/compare/develop...merge_master_into_develop_after_release_${MVN_VERSION_RELEASE}" | ||
echo "" | ||
echo "When you have created the PR you can press any key to continue. It's ok to merge the PR later, so wait for the Jenkins tests to finish." | ||
echo "Creating pull request to merge the merge-branch into develop" | ||
hub pull-request -f -m "sync develop branch after release ${MVN_VERSION_RELEASE}" -b origin:develop | ||
echo "It's ok to merge this PR later, so wait for the Jenkins tests to finish." | ||
read -n 1 -s -r -p "Press any key to continue (ctrl+c to cancel)"; printf "\n\n"; | ||
|
||
git checkout $MVN_VERSION_RELEASE | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we use the official command line client instead? https://cli.github.com/
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.
Or is the benefit of using hub that we don’t have to log in again?
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.
Btw. We need to test that hub (or whatever we end up with) works as an early step in the script. So it doesn’t crash half way through.
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 wasn't aware there was another client, I thought
hub
is the official client. Happy to consider alternatives if they're better.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.
No and actually that brings up a point: you need to set this tool up first before it works.