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

Commit 4ac8aca

Browse files
j-leaBrian Butztextbook
authored
Deployment Instructions for TAS (#233)
* Update README and deployment instructions to stop referring to Pivotal Cloud Foundry and instead just to Cloud Foundry Signed-off-by: Othman Alkhamra <[email protected]> * Add deployment script and instructions for TAS Signed-off-by: Othman Alkhamra <[email protected]> * Update Tanzu deployment instructions * Update deployment instructions to clarify downloading the package first * Replace CF with TAS in deploy-tas.sh * Update deployment README for clarity * Make README links relative * Apply suggestions from code review Tidy up wording around PWS/CF/TAS in upgrade and deploy instructions. Co-authored-by: Jonathan Sharpe <[email protected]> * Remove TAS migrate script as there will be no existing installations < 4.0.0 * Add table of contents to deployment readme Co-authored-by: Brian Butz <[email protected]> Co-authored-by: Jonathan Sharpe <[email protected]>
1 parent 7803e4d commit 4ac8aca

11 files changed

+253
-44
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Postfacto helps teams run great [retrospectives](https://content.pivotal.io/blog
1414
Postfacto lets you run an agile retrospective even when your team is distributed across the world. Your retros will live update across all your devices so each participant can follow along on their device.
1515

1616
### Easy Onboarding
17-
Easily [set up](https://github.com/pivotal/postfacto/tree/master/deployment#allowing-users-to-create-retros) Postfacto to work with Google OAuth so users can sign up with their Google accounts. Alternatively, you can control access to your instance with the admin dashboard.
17+
Easily [set up](deployment/README.md#allowing-users-to-create-retros) Postfacto to work with Google OAuth so users can sign up with their Google accounts. Alternatively, you can control access to your instance with the admin dashboard.
1818

1919
### Run Public or Private Retros
2020
You can create private retro boards for your team that are password protected or choose to leave them public so that anyone you give the link to can access them.
@@ -28,22 +28,22 @@ Retros are designed to help teams improve and that's hard to do without taking a
2828

2929
## Deployment
3030

31-
Postfacto is a self hosted product, this makes it easier for you to stay in control of your data. We aim to make it easy to deploy to as many locations as possible. We currently support the following:
31+
Postfacto is a self hosted product, this makes it easier for you to stay in control of your data. We aim to make it easy to deploy to as many locations as possible.
3232

33-
* [Cloud Foundry](https://github.com/pivotal/postfacto/tree/master/deployment#pivotal-cloud-foundry)
34-
* [Pivotal Web Services](https://github.com/pivotal/postfacto/tree/master/deployment#pivotal-web-services)
35-
* [Heroku](https://github.com/pivotal/postfacto/tree/master/deployment#heroku)
33+
First, download and extract the latest package from the [releases page](https://github.com/pivotal/postfacto/releases) before following the instructions below for your supported platform:
3634

37-
**Note: Download and extract the latest package from the [releases page](https://github.com/pivotal/postfacto/releases) before following the instructions above.**
35+
* [Tanzu Application Service](deployment/README.md#tanzu-application-service)
36+
* [Pivotal Web Services](deployment/README.md#pivotal-web-services)
37+
* [Cloud Foundry](deployment/README.md#cloud-foundry)
38+
* [Heroku](deployment/README.md#heroku)
3839

3940
If the platforms above don't work for you; you may be able to find a way to run Postfacto yourself by following the Contributing Guide.
4041

4142
## Contributing
4243

43-
See the [Contributing Guide](https://github.com/pivotal/postfacto/blob/master/CONTRIBUTING.md) for more info.
44+
See the [Contributing Guide](CONTRIBUTING.md) for more info.
4445

4546
## License
4647

4748
Postfacto is licensed under the **GNU Affero General Public License** (often referred to as **AGPL-3.0**). The full text
48-
of the license is available [here](https://github.com/pivotal/postfacto/blob/master/LICENSE.md). It's important to note
49-
that this license allows you to deploy an instance of Postfacto for private, public or internal use.
49+
of the license is available [here](LICENSE.md). It's important to note that this license allows you to deploy an instance of Postfacto for private, public or internal use.

UPGRADES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To update the version of Ruby used in Postfacto, the following steps need to be
2525

2626
9. Publish the new image to Docker Hub - this needs to happen *before* the Travis build can complete
2727

28-
10. Update the pinned buildpacks in `deployment/{pcf,pws}/config/manifest-api.yml`, according to the latest
28+
10. Update the pinned buildpacks in `deployment/{cf,pws,tas}/config/manifest.yml`, according to the latest
2929
[release][2] that supports the selected version
3030

3131
11. Update the pinned buildpacks in `deployment/{deploy,upgrade}-heroku.sh`, according to the latest [release][3] that

deployment/README.md

+58-25
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,47 @@
11
# Deployment
22

3-
**Note: If you have not already done so, download and extract the latest package from the [releases page](https://github.com/pivotal/postfacto/releases)**
3+
## Contents
4+
* [Prerequisites](#prerequisites)
5+
* [Tanzu Application Service](#tanzu-application-service)
6+
* [Pivotal Web Services](#pivotal-web-services)
7+
* [Cloud Foundry](#cloud-foundry)
8+
* [Heroku](#heroku)
9+
* [Configuration](#configuration)
410

5-
So you're ready to set Postfacto up, choose a name for your app. We'll refer to this as `app-name` from now on.
11+
## Prerequisites
12+
1. Download and extract the latest package from the [releases page](https://github.com/pivotal/postfacto/releases)
13+
2. Choose a name for your app, we'll refer to this as `app-name` from now on
14+
15+
## Tanzu Application Service
16+
17+
#### Initial deployment
18+
19+
1. Set yourself up with an organization and space in your TAS account to deploy Postfacto to.
20+
1. Add a database (Postgres or Mysql) and a Redis service instance to your space from the Marketplace. Name these services `postfacto-db` and `postfacto-redis`.
21+
1. Run the TAS deployment script from the `tas` directory:
22+
23+
```bash
24+
./deploy.sh <app-name>
25+
```
26+
27+
Take note of the URL that has shown up in the `routes:` section of the script output, going forward referred to as `<app-url>`.
28+
1. Log in to the Postfacto admin dashboard (email: `[email protected]` and password: `password`) to check everything has worked at `<app-url>/admin`
29+
1. Create a retro for yourself by clicking on 'Retros' and the 'New Retro'
30+
1. Log in to your retro at `<app-url>/retros/your-retro-slug`
31+
1. Share the URL and password with your team and then run a retro!
32+
33+
#### Upgrading a deployment
34+
35+
1. Presuming the steps in the Initial deployment section have been completed, run the upgrade script from the `tas` directory:
36+
```bash
37+
./upgrade.sh <app-name>
38+
```
639

740
## Pivotal Web Services
841

9-
### Initial deployment
42+
#### Initial deployment
1043

11-
[Pivotal Web Services](https://run.pivotal.io) provides a hosted version of Pivotal's [Cloud Foundry](https://pivotal.io/platform) platform and is probably the easiest place to get Postfacto up and running.
44+
[Pivotal Web Services](https://run.pivotal.io) provides a hosted version of VMware's [Tanzu Application Service](https://tanzu.vmware.com/application-service) platform and is probably the easiest place to get Postfacto up and running.
1245
1346
1. Sign up for a PWS account, install the CF CLI and set yourself up with an organization and space by following the instructions [here](https://docs.run.pivotal.io/starting/)
1447
1. Once logged in to PWS, add a database and a Redis service instance to your space from the Marketplace. We recommend the free plans of ElephantSQL and Redis Cloud respectively for this. Name these services `postfacto-db` and `postfacto-redis`
@@ -17,81 +50,81 @@ So you're ready to set Postfacto up, choose a name for your app. We'll refer to
1750
```bash
1851
./deploy.sh <app-name>
1952
```
20-
1. Log in to the admin dashboard (email: `[email protected]` and password: `password`) to check everything has worked at `<app-name>.cfapps.io/admin`
53+
1. Log in to the Postfacto admin dashboard (email: `[email protected]` and password: `password`) to check everything has worked at `<app-name>.cfapps.io/admin`
2154
1. Create a retro for yourself by clicking on 'Retros' and the 'New Retro'
2255
1. Log in to your retro at `<app-name>.cfapps.io/retros/your-retro-slug`
2356
1. Share the URL and password with your team and then run a retro!
2457
25-
### Upgrading a deployment
58+
#### Upgrading a deployment
2659
2760
1. Presuming the steps in the Initial deployment section have been completed, run the upgrade script from the `pws` directory:
2861
```bash
2962
./upgrade.sh <app-name>
3063
```
3164
32-
### Migrating a deployment
65+
#### Migrating a deployment
3366
3467
1. If you'd previously deployed a version of Postfacto prior to 4.0, run the migration script from the `pws` directory:
3568
```bash
3669
./migrate.sh <web-app-name> <api-app-name>
3770
```
3871
**Note** that the admin panel will move from `<api-app-name>.cfapps.io/admin` to `<web-app-name>.cfapps.io/admin` and the API app will be deleted
3972

40-
## Pivotal Cloud Foundry
73+
## Cloud Foundry
4174

42-
### Initial deployment
75+
#### Initial deployment
4376

44-
1. Set yourself up with an organization and space in your PCF to deploy your Postfacto to.
45-
1. Take note of your PCF url, going forward referred to as `pcf-url`
77+
1. Set yourself up with an organization and space in your CF to deploy your Postfacto to.
78+
1. Take note of your CF url, going forward referred to as `cf-url`
4679
1. Add a database (Postgres or Mysql) and a Redis service instance to your space from the Marketplace. Name these services `postfacto-db` and `postfacto-redis`.
47-
1. Run the PCF deployment script from the `pcf` directory:
80+
1. Run the CF deployment script from the `cf` directory:
4881

4982
```bash
5083
./deploy.sh <app-name>
5184
```
52-
1. Log in to the admin dashboard (email: `[email protected]` and password: `password`) to check everything has worked at `<app-name>.<pcf-url>/admin`
85+
1. Log in to the Postfacto admin dashboard (email: `[email protected]` and password: `password`) to check everything has worked at `<app-name>.<cf-url>/admin`
5386
1. Create a retro for yourself by clicking on 'Retros' and the 'New Retro'
54-
1. Log in to your retro at `<app-name>.<pcf-url>/retros/your-retro-slug`
87+
1. Log in to your retro at `<app-name>.<cf-url>/retros/your-retro-slug`
5588
1. Share the URL and password with your team and then run a retro!
5689

57-
### Upgrading a deployment
90+
#### Upgrading a deployment
5891

59-
1. Presuming the steps in the Initial deployment section have been completed, run the upgrade script from the `pcf` directory:
92+
1. Presuming the steps in the Initial deployment section have been completed, run the upgrade script from the `cf` directory:
6093
```bash
6194
./upgrade.sh <app-name>
6295
```
6396

64-
### Migrating a deployment
97+
#### Migrating a deployment
6598

66-
1. If you'd previously deployed a version of Postfacto prior to 4.0, run the migration script from the `pcf` directory:
99+
1. If you'd previously deployed a version of Postfacto prior to 4.0, run the migration script from the `cf` directory:
67100
```bash
68101
./migrate.sh <web-app-name> <api-app-name>
69102
```
70-
**Note** that the admin panel will move from `<api-app-name>.<pcf-url>/admin` to `<web-app-name>.<pcf-url>/admin` and the API app will be deleted
103+
**Note** that the admin panel will move from `<api-app-name>.<cf-url>/admin` to `<web-app-name>.<cf-url>/admin` and the API app will be deleted
71104
72105
## Heroku
73106
74-
### Initial deployment
107+
#### Initial deployment
75108
76109
1. Install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli)
77110
1. Run the Heroku deployment script from the `heroku` directory:
78111
79112
```bash
80113
./deploy.sh <app-name>
81114
```
82-
1. Log in to the admin dashboard (email: `[email protected]` and password: `password`) to check everything has worked at `<app-name>.herokuapp.com/admin`
115+
1. Log in to the Postfacto admin dashboard (email: `[email protected]` and password: `password`) to check everything has worked at `<app-name>.herokuapp.com/admin`
83116
1. Create a retro for yourself by clicking on 'Retros' and the 'New Retro'
84117
1. Log in to your retro at `<app-name>.herokuapp.com/retros/your-retro-slug`
85118
1. Share the URL and password with your team and then run a retro!
86119
87-
### Upgrading a deployment
120+
#### Upgrading a deployment
88121
89122
1. Presuming the steps in the Initial deployment section have been completed, run the upgrade script from the `heroku` directory:
90123
```bash
91124
./upgrade.sh <app-name>
92125
```
93126
94-
### Migrating a deployment
127+
#### Migrating a deployment
95128
96129
> ⚠️ **Warning**: the Heroku migration will attempt to migrate your data to a new database instance and delete the old one. Take a look at what the script is doing and make sure you understand the implications before running it.
97130
@@ -107,13 +140,13 @@ So you're ready to set Postfacto up, choose a name for your app. We'll refer to
107140

108141
In order for users to sign-up and create their own retros using the web UI, Postfacto needs Google OAuth setup.
109142
For deployments that do not want to setup Google OAuth, you will need to create your retros through the admin console of your server via
110-
`<app-name>.cfapps.io/admin` or `<app-name>.<pcf-url>/admin`.
143+
`<app-name>.cfapps.io/admin` or `<app-name>.<cf-url>/admin`.
111144

112145
1. Go to [Google Cloud Console](https://console.cloud.google.com) and
113146
create a new project
114147
1. Go to APIs & Services > Credentials > Create Credentials > OAuth client ID > Web application
115148
1. Choose a name for your app
116-
1. In `Authorized JavaScript Origins`, set it to the public URL of your `app-name`. For example: if deploying to PWS, your public URL will be `https://<app-name>.<pcf-url>`
149+
1. In `Authorized JavaScript Origins`, set it to the public URL of your `app-name`. For example: if deploying to PWS, your public URL will be `https://<app-name>.cfapps.io`
117150
1. You can leave redirect blank
118151
1. Take note of your `client-id` that is generated
119152
1. Add `"google_oauth_client_id": {{client-id}}` to the `config.js` for your installation.
File renamed without changes.
File renamed without changes.

deployment/deploy-tas.sh

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
#
3+
# Postfacto, a free, open-source and self-hosted retro tool aimed at helping
4+
# remote teams.
5+
#
6+
# Copyright (C) 2016 - Present Pivotal Software, Inc.
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
#
10+
# it under the terms of the GNU Affero General Public License as
11+
#
12+
# published by the Free Software Foundation, either version 3 of the
13+
#
14+
# License, or (at your option) any later version.
15+
#
16+
#
17+
#
18+
# This program is distributed in the hope that it will be useful,
19+
#
20+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
#
22+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
#
24+
# GNU Affero General Public License for more details.
25+
#
26+
#
27+
#
28+
# You should have received a copy of the GNU Affero General Public License
29+
#
30+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
31+
#
32+
set -euo pipefail
33+
34+
if [ $# -lt 1 ]; then
35+
echo "usage: ./deploy.sh <app-name>"
36+
echo "This will deploy the app to a TAS instance of your choosing"
37+
exit 1
38+
fi
39+
# The directory in which this script is located
40+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
41+
"$SCRIPT_DIR/mixpanel.sh" "TAS $(basename "${BASH_SOURCE[0]}")" "$@"
42+
43+
APP_HOST=$1
44+
SESSION_TIME=${SESSION_TIME:-'""'}
45+
46+
ASSETS_DIR="$SCRIPT_DIR/../assets"
47+
CONFIG_DIR="$SCRIPT_DIR/config"
48+
49+
cf target \
50+
|| (echo 'You need to have the CF CLI installed and be logged in' \
51+
&& exit 1)
52+
53+
cp "$CONFIG_DIR/config.js" "$ASSETS_DIR/client/config.js"
54+
cf push -f "$CONFIG_DIR"/manifest.yml -p "$ASSETS_DIR" --var api-app-name=$APP_HOST --var session-time=$SESSION_TIME
55+
cf run-task $APP_HOST '[email protected] ADMIN_PASSWORD=password rake admin:create_user'

deployment/tas/config/config.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
Postfacto, a free, open-source and self-hosted retro tool aimed at helping remote teams.
3+
4+
Copyright (C) 2016 - Present Pivotal Software, Inc.
5+
6+
This program is free software: you can redistribute it and/or modify
7+
8+
it under the terms of the GNU Affero General Public License as
9+
10+
published by the Free Software Foundation, either version 3 of the
11+
12+
License, or (at your option) any later version.
13+
14+
15+
16+
This program is distributed in the hope that it will be useful,
17+
18+
but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
20+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
22+
GNU Affero General Public License for more details.
23+
24+
25+
26+
You should have received a copy of the GNU Affero General Public License
27+
28+
along with this program. If not, see <https://www.gnu.org/licenses/>.
29+
*/
30+
window.Retro = {
31+
config: {
32+
"globalNamespace": "Retro",
33+
"title": "Postfacto",
34+
"scripts": ["application.js"],
35+
"stylesheets": ["application.css"],
36+
"useRevManifest": true,
37+
"api_base_url": "/api",
38+
"websocket_url": "/cable",
39+
"enable_analytics": false,
40+
"contact": "",
41+
"terms": "",
42+
"privacy": ""
43+
}
44+
};

deployment/tas/config/manifest.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
applications:
3+
- name: ((api-app-name))
4+
instances: 2
5+
buildpacks:
6+
- https://github.com/cloudfoundry/ruby-buildpack.git#v1.7.40
7+
memory: 256M
8+
command: bundle exec rake db:migrate && bundle exec rails s -p $PORT -e $RAILS_ENV
9+
services:
10+
- postfacto-db
11+
- postfacto-redis
12+
env:
13+
WEBSOCKET_PORT: 443
14+
SESSION_TIME: ((session-time))

deployment/upgrade-tas.sh

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
#
3+
# Postfacto, a free, open-source and self-hosted retro tool aimed at helping
4+
# remote teams.
5+
#
6+
# Copyright (C) 2016 - Present Pivotal Software, Inc.
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
#
10+
# it under the terms of the GNU Affero General Public License as
11+
#
12+
# published by the Free Software Foundation, either version 3 of the
13+
#
14+
# License, or (at your option) any later version.
15+
#
16+
#
17+
#
18+
# This program is distributed in the hope that it will be useful,
19+
#
20+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
#
22+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
#
24+
# GNU Affero General Public License for more details.
25+
#
26+
#
27+
#
28+
# You should have received a copy of the GNU Affero General Public License
29+
#
30+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
31+
#
32+
set -euo pipefail
33+
34+
if [ $# -lt 1 ]; then
35+
echo "usage: ./upgrade.sh <app-name>"
36+
echo "This will upgrade the app on a TAS instance of your choosing"
37+
exit 1
38+
fi
39+
40+
# The directory in which this script is located
41+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
42+
"$SCRIPT_DIR/mixpanel.sh" "CF $(basename "${BASH_SOURCE[0]}")" "$@"
43+
44+
APP_HOST=$1
45+
SESSION_TIME=${SESSION_TIME:-'""'}
46+
47+
ASSETS_DIR="$SCRIPT_DIR/../assets"
48+
CONFIG_DIR="$SCRIPT_DIR/config"
49+
50+
cf target \
51+
|| (echo 'You need to have the CF CLI installed and be logged in' \
52+
&& exit 1)
53+
54+
cp "$CONFIG_DIR/config.js" "$ASSETS_DIR/client/config.js"
55+
cf push -f "$CONFIG_DIR/manifest.yml" -p "$ASSETS_DIR" --var api-app-name=$APP_HOST --var session-time=$SESSION_TIME

0 commit comments

Comments
 (0)