From 1b8ccb9aac8e511076c979c6da43f0c1dc5a8cd3 Mon Sep 17 00:00:00 2001 From: Jonathan Sharpe Date: Mon, 12 Aug 2019 11:25:29 +0100 Subject: [PATCH] Fix missing var in CF upgrade script and remove login Removing the login makes it easier to use e.g. SSO-only foundations. Also includes the file rename suggested by @mamachenko. --- deployment/{INSTRUCTIONS.md => README.md} | 4 ++-- deployment/deploy-cf.sh | 7 ++++--- deployment/upgrade-cf.sh | 9 +++++---- humans.txt | 3 +++ package.sh | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) rename deployment/{INSTRUCTIONS.md => README.md} (97%) diff --git a/deployment/INSTRUCTIONS.md b/deployment/README.md similarity index 97% rename from deployment/INSTRUCTIONS.md rename to deployment/README.md index 4b819a7..08b7665 100644 --- a/deployment/INSTRUCTIONS.md +++ b/deployment/README.md @@ -37,7 +37,7 @@ So you're ready to set Postfacto up, choose names for your web and API apps. We' 1. Run the PCF deployment script from the `pcf` directory: ```bash - ./deploy.sh + ./deploy.sh ``` 1. Log in to the admin dashboard (email: `email@example.com` and password: `password`) to check everything has worked at `api-app-name.{{pcf-url}}/admin` 1. Create a retro for yourself by clicking on 'Retros' and the 'New Retro' @@ -48,7 +48,7 @@ So you're ready to set Postfacto up, choose names for your web and API apps. We' 1. Presuming the steps in the Initial deployment section have been completed, run the upgrade script from the `pcf` directory: ```bash - ./upgrade.sh + ./upgrade.sh ``` diff --git a/deployment/deploy-cf.sh b/deployment/deploy-cf.sh index 1aff293..924c99a 100644 --- a/deployment/deploy-cf.sh +++ b/deployment/deploy-cf.sh @@ -4,8 +4,7 @@ set -e WEB_HOST=$1 API_HOST=$2 -API_ENDPOINT=${3:-https://api.run.pivotal.io} -APP_DOMAIN=${4:-cfapps.io} +APP_DOMAIN=${3:-cfapps.io} SESSION_TIME=${SESSION_TIME:-'""'} # The directory in which this script is located @@ -13,7 +12,9 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ASSETS_DIR="$SCRIPT_DIR"/assets CONFIG_DIR="$SCRIPT_DIR"/config -cf login -a "${API_ENDPOINT}" +cf target \ + || (echo 'You need to have the CF CLI installed and be logged in' \ + && exit 1) cf push -f "$CONFIG_DIR"/manifest-api.yml -p "$ASSETS_DIR"/api --var api-app-name=$API_HOST --var web-app-name=$WEB_HOST --var pcf-url=${APP_DOMAIN} --var session-time=$SESSION_TIME cf run-task $API_HOST 'ADMIN_EMAIL=email@example.com ADMIN_PASSWORD=password rake admin:create_user' diff --git a/deployment/upgrade-cf.sh b/deployment/upgrade-cf.sh index 52007ed..87646c8 100644 --- a/deployment/upgrade-cf.sh +++ b/deployment/upgrade-cf.sh @@ -4,8 +4,7 @@ set -e WEB_HOST=$1 API_HOST=$2 -API_ENDPOINT=${3:-https://api.run.pivotal.io} -APP_DOMAIN=${4:-cfapps.io} +APP_DOMAIN=${3:-cfapps.io} SESSION_TIME=${SESSION_TIME:-'""'} # The directory in which this script is located @@ -13,9 +12,11 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ASSETS_DIR="$SCRIPT_DIR"/assets CONFIG_DIR="$SCRIPT_DIR"/config -cf login -a $API_ENDPOINT +cf target \ + || (echo 'You need to have the CF CLI installed and be logged in' \ + && exit 1) -cf push -f "$CONFIG_DIR"/manifest-api.yml -p "$ASSETS_DIR"/api --var api-app-name=$API_HOST --var web-app-name=$WEB_HOST --var pcf-url=$CF_URL --var session-time=$SESSION_TIME +cf push -f "$CONFIG_DIR"/manifest-api.yml -p "$ASSETS_DIR"/api --var api-app-name=$API_HOST --var web-app-name=$WEB_HOST --var pcf-url=${APP_DOMAIN} --var session-time=$SESSION_TIME sed \ -e "s/{{api-app-name}}/${API_HOST}/" \ diff --git a/humans.txt b/humans.txt index 6e9ec81..551864c 100644 --- a/humans.txt +++ b/humans.txt @@ -49,3 +49,6 @@ Contact: callum@seadowg.com Engineer: Mike Kenyon Contact: mike.kenyon@gmail.com + +Engineer: Max Brauer +Contact: github.com/mamachanko diff --git a/package.sh b/package.sh index e85832a..e004d6e 100755 --- a/package.sh +++ b/package.sh @@ -54,7 +54,7 @@ cp -r web/build package/heroku/assets/web/public_html # Docs -cp deployment/INSTRUCTIONS.md package +cp deployment/README.md package # Zip