Created
April 12, 2018 08:20
-
-
Save kenglxn/900901598b00fb9dd9da5364a15ede33 to your computer and use it in GitHub Desktop.
ao feature branch util function
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
function rm_f_branch | |
if test (count $argv) -eq 2 | |
set jira $argv[1] | |
set prefix $argv[2] | |
set env_name (echo utv-$prefix-$jira | tr '[:upper:]' '[:lower:]') | |
pushd ~/dev/git/sirius | |
echo "Deleting feature branch for $env_name" | |
echo "-> Performing AO login" | |
ao login sirius | |
echo "-> Pulling from remote" | |
git pull | |
echo "-> Remove feature branch from sirius repo" | |
git rm -r $env_name | |
git commit -m 'Sletter miljø for feature '$jira | |
git push | |
echo "-> Deleting openshift project from cluster" | |
oc login https://utv-master.paas.skead.no:8443 | |
oc delete project sirius-$env_name | |
popd | |
else | |
echo "deletes feature branch environment on aurora openshift" | |
echo "" | |
echo "usage:" | |
echo "rm_f_branch <JIRA-ID> <feature|bugfix>" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$> rm_f_branch
deletes feature branch environment on aurora openshift
usage:
rm_f_branch <feature|bugfix>