This repository has been archived by the owner on Apr 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from IBM-Bluemix/extract-scripts
extract pipeline scripts to repo
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |