Skip to content

Instantly share code, notes, and snippets.

@kenglxn
Created April 12, 2018 08:20
Show Gist options
  • Save kenglxn/900901598b00fb9dd9da5364a15ede33 to your computer and use it in GitHub Desktop.
Save kenglxn/900901598b00fb9dd9da5364a15ede33 to your computer and use it in GitHub Desktop.
ao feature branch util function
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
@kenglxn
Copy link
Author

kenglxn commented Apr 12, 2018

$> rm_f_branch
deletes feature branch environment on aurora openshift

usage:
rm_f_branch <feature|bugfix>

@kenglxn
Copy link
Author

kenglxn commented Apr 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment