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

Commit

Permalink
Merge pull request #16 from IBM-Bluemix/extract-scripts
Browse files Browse the repository at this point in the history
extract pipeline scripts to repo
  • Loading branch information
l2fprod committed Dec 15, 2016
2 parents 56d0ae4 + 8aa01af commit a132d03
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .bluemix/pipeline-DEPLOY.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# Set app's env vars
domain=".mybluemix.net"
case "${REGION_ID}" in
ibm:yp:eu-gb)
domain=".eu-gb.mybluemix.net"
;;
ibm:yp:au-syd)
domain=".au-syd.mybluemix.net"
;;
esac
# Deploy app
if ! cf app $CF_APP; then
cf push $CF_APP -n $CF_APP --no-start
cf set-env $CF_APP LOGISTICS_WIZARD_ENV ${LOGISTICS_WIZARD_ENV}
cf set-env $CF_APP ERP_SERVICE https://$ERP_SERVICE_APP_NAME$domain
cf set-env $CF_APP OPENWHISK_AUTH "${OPENWHISK_AUTH}"
cf set-env $CF_APP OPENWHISK_PACKAGE ${RECOMMENDATION_PACKAGE_NAME}
cf start $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
fi
exit 1
}
set -e
trap rollback ERR
cf rename $CF_APP $OLD_CF_APP
cf push $CF_APP -n $CF_APP --no-start
cf set-env $CF_APP LOGISTICS_WIZARD_ENV ${LOGISTICS_WIZARD_ENV}
cf set-env $CF_APP ERP_SERVICE https://$ERP_SERVICE_APP_NAME$domain
cf set-env $CF_APP OPENWHISK_AUTH "${OPENWHISK_AUTH}"
cf set-env $CF_APP OPENWHISK_PACKAGE ${RECOMMENDATION_PACKAGE_NAME}
cf start $CF_APP
cf delete $OLD_CF_APP -f
fi
14 changes: 14 additions & 0 deletions .bluemix/pipeline-TEST.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Download Python dependencies
sudo pip install virtualenv
virtualenv venv
source venv/bin/activate
export PYTHONPATH=$PWD
pip install -r requirements.dev.txt
# Run unit and coverage tests
coverage run server/tests/run_unit_tests.py
if [ -z ${COVERALLS_REPO_TOKEN} ]; then
echo No Coveralls token specified, skipping coveralls.io upload
else
COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN coveralls
fi

0 comments on commit a132d03

Please sign in to comment.