This repository has been archived by the owner on Mar 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75d8c4a
commit 5d19bbf
Showing
3 changed files
with
86 additions
and
9 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
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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ -z "$1" ]; then | ||
echo "Missing PAAS space argument" | ||
echo " deploy.sh staging|production" | ||
exit 1 | ||
fi | ||
|
||
PAAS_SPACE=$1 | ||
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - | ||
echo "deb http://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | ||
sudo apt-get update && sudo apt-get install cf-cli | ||
|
||
cf login -u $PAAS_USER -p $PAAS_PASSWORD -a https://api.cloud.service.gov.uk -o gds-performance-platform -s $PAAS_SPACE | ||
|
||
# bind services | ||
cf bind-service performance-platform-backdrop-read gds-performance-platform-mongodb-service | ||
cf bind-service performance-platform-backdrop-write gds-performance-platform-mongodb-service | ||
|
||
# set environmental variables | ||
cf set-env performance-platform-backdrop-read ENVIRONMENT $PAAS_SPACE | ||
cf set-env performance-platform-backdrop-read STAGECRAFT_URL https://performance-platform-stagecraft-$PAAS_SPACE.cloudapps.digital | ||
cf set-env performance-platform-backdrop-read SIGNON_API_USER_TOKEN $APP_SIGNON_API_USER_TOKEN | ||
|
||
cf set-env performance-platform-backdrop-write ENVIRONMENT $PAAS_SPACE | ||
cf set-env performance-platform-backdrop-write STAGECRAFT_URL https://performance-platform-stagecraft-$PAAS_SPACE.cloudapps.digital | ||
cf set-env performance-platform-backdrop-write SIGNON_API_USER_TOKEN $APP_SIGNON_API_USER_TOKEN | ||
|
||
# deploy apps | ||
cf push -f manifest.yml | ||
|
||
# create and map routes | ||
cf map-route performance-platform-backdrop-read cloudapps.digital --hostname performance-platform-backdrop-read-$PAAS_SPACE | ||
cf map-route performance-platform-backdrop-write cloudapps.digital --hostname performance-platform-backdrop-write-$PAAS_SPACE |
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,18 @@ | ||
--- | ||
buildpack: python_buildpack | ||
name: performance-platform-backdrop | ||
services: | ||
- gds-performance-platform-mongodb-service | ||
memory: 256M | ||
applications: | ||
- name: performance-platform-backdrop-read | ||
command: python start.py read 8080 | ||
instances: 1 | ||
memory: 512M | ||
health-check-type: none | ||
|
||
- name: performance-platform-backdrop-write | ||
command: python start.py write 8080 | ||
instances: 1 | ||
memory: 512M | ||
health-check-type: none |