forked from eksctl-io/eksctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- validate remote points at upstream - push to release branch instead of master
- Loading branch information
1 parent
66c210f
commit 67c6ea9
Showing
2 changed files
with
33 additions
and
14 deletions.
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 |
---|---|---|
|
@@ -23,13 +23,22 @@ if ! [[ "${release_branch}" =~ ^release-[0-9]+\.[0-9]+$ ]] ; then | |
exit 3 | ||
fi | ||
|
||
if git remote get-url origin | grep -v "[email protected]:weaveworks/eksctl" ; then | ||
echo "Invalid origin: $(git remote get-url origin)" | ||
exit 3 | ||
if | ||
|
||
function branch_exists() { | ||
git ls-remote --heads [email protected]:weaveworks/eksctl.git "${1}" | grep "${1}" >/dev/null | ||
git ls-remote --heads origin "${1}" | grep -q "${1}" | ||
} | ||
|
||
function current_branch() { | ||
git rev-parse --abbrev-ref @ | ||
} | ||
|
||
if ! branch_exists "${release_branch}" ; then | ||
git checkout master | ||
if [ ! "$(git rev-parse --abbrev-ref @)" = master ] ; then | ||
if [ ! "$(current_branch)" = master ] ; then | ||
echo "Must be on master branch" | ||
exit 4 | ||
fi | ||
|
@@ -45,7 +54,7 @@ fi | |
# origin and fast-forwarding the local branch: | ||
git fetch origin "${release_branch}" | ||
git checkout "${release_branch}" | ||
if [ ! "$(git rev-parse --abbrev-ref @)" = "${release_branch}" ] ; then | ||
if [ ! "$(current_branch)" = "${release_branch}" ] ; then | ||
echo "Must be on ${release_branch} branch" | ||
exit 5 | ||
fi | ||
|
@@ -69,10 +78,10 @@ m="Tag ${v} release candidate" | |
|
||
git commit --message "${m}" | ||
|
||
git fetch --force --tags [email protected]:weaveworks/eksctl | ||
git fetch --force --tags origin | ||
|
||
git push [email protected]:weaveworks/eksctl master | ||
git push origin "${release_branch}" | ||
|
||
git tag --annotate --message "${m}" "${v}" | ||
|
||
git push --force --tags [email protected]:weaveworks/eksctl | ||
git push --force --tags origin |
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ set -o errexit | |
set -o pipefail | ||
set -o nounset | ||
|
||
|
||
if [ "$#" -ne 1 ] ; then | ||
echo "Usage: ${0} <tag>" | ||
exit 1 | ||
|
@@ -22,15 +23,24 @@ if ! [[ "${release_branch}" =~ ^release-[0-9]+\.[0-9]+$ ]] ; then | |
exit 3 | ||
fi | ||
|
||
if git remote get-url origin | grep -v "[email protected]:weaveworks/eksctl" ; then | ||
echo "Invalid origin: $(git remote get-url origin)" | ||
exit 3 | ||
if | ||
|
||
function branch_exists() { | ||
git ls-remote --heads [email protected]:weaveworks/eksctl.git "${1}" | grep "${1}" >/dev/null | ||
git ls-remote --heads "${origin}" "${1}" | grep -q "${1}" | ||
} | ||
|
||
function current_branch() { | ||
git rev-parse --abbrev-ref @ | ||
} | ||
|
||
if ! branch_exists "${release_branch}" ; then | ||
git checkout master | ||
if [ ! "$(git rev-parse --abbrev-ref @)" = master ] ; then | ||
if [ ! "$(current_branch)" = master ] ; then | ||
echo "Must be on master branch" | ||
exit 4 | ||
exit 7 | ||
fi | ||
# Ensure local master is up-to-date by pulling its latest version from origin | ||
# and fast-forwarding local master: | ||
|
@@ -44,7 +54,7 @@ fi | |
# origin and fast-forwarding the local branch: | ||
git fetch origin "${release_branch}" | ||
git checkout "${release_branch}" | ||
if [ ! "$(git rev-parse --abbrev-ref @)" = "${release_branch}" ] ; then | ||
if [ ! "$(current_branch)" = "${release_branch}" ] ; then | ||
echo "Must be on ${release_branch} branch" | ||
exit 5 | ||
fi | ||
|
@@ -68,15 +78,15 @@ m="Tag ${v} release" | |
|
||
git commit --message "${m}" | ||
|
||
git fetch --force --tags [email protected]:weaveworks/eksctl | ||
git fetch --force --tags origin | ||
|
||
git push [email protected]:weaveworks/eksctl master | ||
git push origin "${release_branch}" | ||
|
||
# Update the site by putting everything from master into the docs branch | ||
git push -f origin master:docs | ||
git push --force origin "${release_branch}":docs | ||
|
||
# Create the release tag and push it to start release process | ||
git tag --annotate --message "${m}" --force "latest_release" | ||
git tag --annotate --message "${m}" "${v}" | ||
|
||
git push --force --tags [email protected]:weaveworks/eksctl | ||
git push --force --tags origin |