Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

Commit

Permalink
update cf commands
Browse files Browse the repository at this point in the history
  • Loading branch information
van-ibm committed Jun 22, 2018
1 parent 95f3d5c commit 7b80050
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .bluemix/pipeline-DEPLOY.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash
# Push the app
if ! cf app $CF_APP; then
cf push $CF_APP -n $CF_APP
if ! bx app show $CF_APP; then
bx app push $CF_APP -n $CF_APP
else
OLD_CF_APP=${CF_APP}-OLD-$(date +"%s")
rollback() {
set +e
if cf app $OLD_CF_APP; then
cf logs $CF_APP --recent
cf delete $CF_APP -f
cf rename $OLD_CF_APP $CF_APP
if bx app show $OLD_CF_APP; then
bx app logs $CF_APP --recent
bx app delete $CF_APP -f
bx app rename $OLD_CF_APP $CF_APP
fi
exit 1
}
set -e
trap rollback ERR
cf rename $CF_APP $OLD_CF_APP
cf push $CF_APP -n $CF_APP
cf delete $OLD_CF_APP -f
bx app rename $CF_APP $OLD_CF_APP
bx app push $CF_APP -n $CF_APP
bx app delete $OLD_CF_APP -f
fi

0 comments on commit 7b80050

Please sign in to comment.