Skip to content

Instantly share code, notes, and snippets.

@kenglxn
Last active May 28, 2018 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenglxn/370e95225bffaf92ac58c4675639491d to your computer and use it in GitHub Desktop.
Save kenglxn/370e95225bffaf92ac58c4675639491d to your computer and use it in GitHub Desktop.
ao feature branch util function
function mk_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 "Creating new feature branch for $env_name"
echo "-> Performing AO login"
ao login sirius
echo "-> Pulling from remote"
git pull
echo "-> Copy feature branch from 'utv-feature-mal' template"
mkdir $env_name
cp -r utv-feature-mal/*.json $env_name/.
git add $env_name
git commit -m "Oppretter miljø for "$jira
git push
echo "-> Performing AO deploy"
ao deploy $env_name
popd
else
echo "create new feature branch environment on aurora openshift"
echo ""
echo "usage:"
echo "mk_f_branch <JIRA-ID> <feature|bugfix>"
end
end
@kenglxn
Copy link
Author

kenglxn commented Apr 10, 2018

$> mk_f_branch                           
create new feature branch environment on aurora openshift

usage:
mk_f_branch <JIRA-ID> <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