23 lines
438 B
Bash
Executable File
23 lines
438 B
Bash
Executable File
#!/bin/bash
|
|
|
|
function die {
|
|
echo $*
|
|
exit 1
|
|
}
|
|
|
|
ENVIRONMENT=""
|
|
while [[ "$1" != "" ]]; do
|
|
case "$1" in
|
|
"--staging") ENVIRONMENT="staging";;
|
|
"--prod") ENVIRONMENT="prod";;
|
|
*) die "Please specify environment: --staging or --prod";;
|
|
esac
|
|
done
|
|
|
|
git push \
|
|
&& git checkout $ENVIRONMENT \
|
|
&& git rebase master \
|
|
&& git push \
|
|
&& git checkout master \
|
|
|| die "Could not publish changes"
|