Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Fix missing var in CF upgrade script and remove login
Browse files Browse the repository at this point in the history
Removing the login makes it easier to use e.g. SSO-only foundations.

Also includes the file rename suggested by @mamachenko.
  • Loading branch information
textbook committed Aug 12, 2019
1 parent 0d94c0c commit 1b8ccb9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions deployment/INSTRUCTIONS.md → deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <web-app-name> <api-app-name> <cf-api-endpoint> <pcf-url>
./deploy.sh <web-app-name> <api-app-name> <pcf-url>
```
1. Log in to the admin dashboard (email: `[email protected]` 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'
Expand All @@ -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 <web-app-name> <api-app-name>
./upgrade.sh <web-app-name> <api-app-name> <pcf-url>
```


Expand Down
7 changes: 4 additions & 3 deletions deployment/deploy-cf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ 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
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 '[email protected] ADMIN_PASSWORD=password rake admin:create_user'
Expand Down
9 changes: 5 additions & 4 deletions deployment/upgrade-cf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ 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
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}/" \
Expand Down
3 changes: 3 additions & 0 deletions humans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ Contact: [email protected]

Engineer: Mike Kenyon
Contact: [email protected]

Engineer: Max Brauer
Contact: github.com/mamachanko
2 changes: 1 addition & 1 deletion package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1b8ccb9

Please sign in to comment.