better environment messaging, cf_certify_push will send cf to other environments

This commit is contained in:
Haak Saxberg 2014-08-07 15:53:46 -07:00
parent 99a1b2bb39
commit 7866cf577e
2 changed files with 52 additions and 4 deletions

View file

@ -6,6 +6,11 @@ set -e
main() { main() {
PUSHBRANCH=$1 PUSHBRANCH=$1
if [ -z "$STAGE" ]; then
echo "You must specify the \$STAGE variable."
exit 1
fi
git fetch git fetch
git checkout "$PUSHBRANCH" git checkout "$PUSHBRANCH"
git reset --hard "origin/$PUSHBRANCH" git reset --hard "origin/$PUSHBRANCH"
@ -15,10 +20,20 @@ main() {
git log --graph --oneline --color origin/master^..HEAD | sed "/$MASTER_SHA/q" git log --graph --oneline --color origin/master^..HEAD | sed "/$MASTER_SHA/q"
separator separator
echo "*** push this deploy branch into master?" echo -e "${AQUA}*** push this deploy branch into master? ***${NORMAL}"
if yesno; then if yesno; then
push-to-master $PUSHBRANCH push-to-master $PUSHBRANCH
DEPLOY_TAG=""
get-deploy-tag $DEPLOY_TAG
echo "Using $DEPLOY_TAG as the deploy tag"
deploy-to-testopia $DEPLOY_TAG
deploy-to-devc $DEPLOY_TAG
deploy-to-devb $DEPLOY_TAG
cleanup-deploy-branch $PUSHBRANCH cleanup-deploy-branch $PUSHBRANCH
reminder
fi fi
} }
@ -42,10 +57,43 @@ push-to-master() {
git push origin master git push origin master
} }
get-deploy-tag() {
DEPLOY_TAG=$1
DEPLOY_TAG=`deploy-srv-testopia -l --source="$STAGE" checkout_fulfillment | tail -1`
echo -e "${AQUA}*** Confirm this is the correct deploy-tag ***${NORMAL}"
echo -e "${RED}$DEPLOY_TAG${NORMAL}"
if yesno; then
return 0
else
exit 1
fi
}
deploy-to-testopia() {
DEPLOY_TAG=$1
colorize deploy-srv-testopia --no-prompt --source=$STAGE checkout_fulfillment $DEPLOY_TAG
}
deploy-to-devc() {
DEPLOY_TAG=$1
colorize deploy-srv-devc --no-prompt --source=$STAGE checkout_fulfillment $DEPLOY_TAG
}
deploy-to-devb() {
DEPLOY_TAG=$1
colorize deploy-srv-devb --no-prompt --source=$STAGE checkout_fulfillment $DEPLOY_TAG
}
cleanup-deploy-branch() { cleanup-deploy-branch() {
PUSHBRANCH=$1 PUSHBRANCH=$1
colorize git push origin :"$PUSHBRANCH" # colorize git push origin :"$PUSHBRANCH"
colorize git branch -d $PUSHBRANCH colorize git branch -D $PUSHBRANCH
}
reminder() {
figlet "Don't forget..."
echo "run the pushplans on the stage you didn't use!"
} }
main $@ main $@

View file

@ -99,5 +99,5 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}☢%{$RESET_COLOR%}"
PROMPT=' PROMPT='
%{$fg_bold[green]%}[%n@%m] %{$fg[yellow]%}[%~]%{$reset_color%} %{$fg_bold[green]%}[%n@%m] %{$fg[yellow]%}[%~]%{$reset_color%}
%$(in_sandbox){$fg[blue]%}>%{$reset_color%} ' $(in_sandbox)%{$fg[blue]%}>%{$reset_color%} '
RPROMPT='$(git_prompt_ahead)$(parse_git_dirty) $(branch_prompt)%{$reset_color%} %{$reset_color%}' RPROMPT='$(git_prompt_ahead)$(parse_git_dirty) $(branch_prompt)%{$reset_color%} %{$reset_color%}'