Deployment Guide

Team 29

Introduction

Our system is split into two distinct halves. One is the app which includes the react front-end and the Azure function back end, the deployment for which is nearly entirely automated by scripts in the deploy folder. The other is the Sharepoint side of our project for which automatic deployment is not possible. TODO: the "Sharepoint" deployment isn't just sharepoint and some of it is automated, this sentence should be fixed.

I - The Sharepoint deployment

The Sharepoint deployment must happen before the app deployment as the app depends on URLs from the Sharepoint deployment. Below is the guide for SharePoint deployment: Deployment Guide

II - The app deployment

Dependencies

App configuration

The deployment of the app is configured using a file called app_config.yaml. It is configured so that it will not be stored in the git history as it may contain sensitive information. An example is found at app_config.yaml.example. You should copy this file and rename the copy to app_config.yaml. It must be stored in the root of the project. The example file is self documented.

Deploy script

The next commands assume that you have a shell open in the deploy directory.

Before you begin the deployment script you must first setup the environment by running the setup_env.sh script. This will install the python dependencies for the script. To run the script you can run sh setup_env.sh or ./setup_env.sh. Once that's done you can enter the python virtual environment by running source env/bin/activate (NOTE: you can skip entering the virtualenv if pyyaml is installed globally, but this it not recommended).

You are now ready to run python deploy.py (again assuming that python3 is installed as python).

It will first check all the dependencies telling you if you need to install anything or run any commands. If everything is ready to go it will print out your deploy config and the subscription that it's going to deploy to, if it looks good you can type y and then hit enter.

The deployment of azure resources can take a very long time (sometimes multiple hours) so you need to be patient. You may be asked for confirmation later on, usually you can just accept.

Post deployment

At the end of the deployment you are given the deployed URL of the app (future developers extending our app will allow for custom URLs to be given rather than long auto-generated ones).

You should create backups of the app_config.yaml file in the root and the file terraform.tfstate in the terraform folder. Both these files are hidden from the git history and both contain sensitive data and they are all that is required (apart from the source code) for redeployment/upgrades. If you do not save the terraform.tfstate and the app is updated you will have to create a new instance of the app (it will not update the old version).

At any time you are able to re-download our source code and then place app_config.yaml and terraform.tfstate in the correct locations and everything will work fine.