Skip to content

Instantly share code, notes, and snippets.

@evrardjp
Created September 23, 2019 14:47
Show Gist options
  • Save evrardjp/6bcfba091ceb907da550d9998580199e to your computer and use it in GitHub Desktop.
Save evrardjp/6bcfba091ceb907da550d9998580199e to your computer and use it in GitHub Desktop.
OpenStack -- Releases -- RC1 autorelease
#!/bin/bash
pushd releases
git checkout master
git pull
releasename="train"
function propose_release(){
rtype=$1
while read line; do
reviewers=""
case $rtype in
"testing")
new_release_args="--stable-branch ${releasename} $line rc"
;;
"automatic")
new_release_args="${releasename} $line feature"
;;
"with-intermediary")
new_release_args="--stable-branch ${releasename} $line feature"
;;
"with-rc")
new_release_args="--stable-branch ${releasename} $line rc"
;;
esac
tox -e venv -- new-release ${new_release_args}
if [[ `git diff --name-only | grep deliverables` ]]; then
git checkout -b rc1-autorelease-$line
git add deliverables/
editedfiles=$(git diff --cached --name-only)
for file in $editedfiles; do
liaisons=$(python tools/get_liaison_emails_for_a_deliverablefile.py ../governance ${file})
if [[ ! -z "${liaisons}" ]]; then
reviewers="${reviewers} ${liaisons}"
fi
done
if [[ ! -z "${reviewers}" ]]; then
gitreviewargs="--reviewers ${reviewers}"
fi
git commit -m "Auto release request for $line"
git show
#git review -f -t rc1-autorelease ${gitreviewargs}
echo "git review -f -t rc1-autorelease ${gitreviewargs}"
git checkout master
git restore --staged deliverables/
git checkout -- deliverables/
git branch -D rc1-autorelease-$line
fi
done < ../cycle-${rtype}
}
propose_release testing
propose_release automatic
propose_release with-intermediary
propose_release with-rc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment