
# PRODUCTION LAUNCH CHECKLIST

TODO
* Note about diff between our redis.conf and default

## Config file setup

* Decide on a server fleet name, `$SERVER_FLEET_NAME`

* Create a folder in `Server_Keys_Production` named `$SERVER_FLEET_NAME`

* On AWS, create a `$SERVER_FLEET_NAME` certificate, and download `$SERVER_FLEET_NAME.pem` file from AWS.

* Move (do not copy!) the .pem file to `Server_Keys_Production\$SERVER_FLEET_NAME\$SERVER_FLEET_NAME.pem`.

* Define fleet specific environment variables:

    - Stripe production token
    - 

* Firebase json config

* Access token private and public keys

* Brightcove private key

* Accounts env

* AllowedApps.json

* Signal env

* Modpanel env

* Website env

* Nginx config files.

* Redis config file (e.g. expirys)

## Jenkins Setup

* New shell, define environment variables

```
JENKINS_USER_NAME='ubuntu'
JENKINS_SERVER_DNS='ec2-34-217-118-93.us-west-2.compute.amazonaws.com'
JENKINS_DEST_PATH=/home/ubuntu
ssh -i "/C/Users/David/Dropbox/Server_Keys/_Jenkins/JenkinsBuildServerA.pem" $JENKINS_USER_NAME@$JENKINS_SERVER_DNS
```

* Copy files to jenkins

* SSH into jenkins

```
ssh -i "/C/Users/David/Dropbox/Server_Keys/_Jenkins/JenkinsBuildServerA.pem" $JENKINS_USER_NAME@$JENKINS_SERVER_DNS
```

* Create folder `terraform/$SERVER_FLEET_NAME`

* Logout

* SCP contents of `Terraform` to `terraform/$SERVER_FLEET_NAME` e.g. 

```
RSYNC_DEST=$JENKINS_USER_NAME@$JENKINS_SERVER_IP:$JENKINS_DEST_PATH
scp -i /C/Users/David/Dropbox/Server_Keys/_Jenkins/JenkinsBuildServerA.pem -r ./Terraform $RSYNC_DEST/terraform/$SERVER_FLEET_NAME
```

* SSH back to jenkins, cd `terraform/$SERVER_FLEET_NAME`

* Define AWS environment variables 

* Have we run the terraform deploy script?


## Jenkins builders


# Production Launch Checklist

1. Is the Stripe API using the production private key on the account server .env file?

2. Have we paid for our IP data provider?

3. Is redis setup on all the production servers?

4. Does redis.conf have `notify-keyspace-events Ex`

5. Is the ghost user destroyer script running on the signal server?

6. Is NODE_ENV === "production"?

7. Check all TODO comments in cinema-web, mod-panel, accounts and signal repositories - is it necessary to deal with these before deploying?

8. Run through all unit tests in accounts and signal repositories

9. Are jenkins auto-deployers disabled for hotel branch in cinema-web, accounts and signal? mod-panel can still have an auto deployer.

10. Do email links redirect to the correct places?

11. Do AWS Security Groups for public ELBs still contain restricted IPs? Have we opened them up to 0.0.0.0/32? (applies to all except the mod panel)

12. Is the server time calibrated to UTC?

13. Check that production .env web hosts all match DNS and ELBs (e.g. www.bigscreenvr.com is the exact production web host).

14. Ensure that brightcove subtitle language codes are two letter ISO 366-1 alpha-2 language codes (e.g. "en", "de" etc).

15. Ensure that all subtitle files are listed as "subtitles" in Brightcove, NOT captions.

16. Check that public data types are not returning private data accidentally. This can happen if the public schema's strict variable is set to false, or a private variable has accidentally been copied to the public schema. (Need unit tests to deal with this later).

17. Check that Jenkins server builders correctly assign the build number to the PM2 name (e.g. HotelAccounts21 instead of just HotelAccounts)

18. Does the lobby contain a running channel video on mute?