-
Notifications
You must be signed in to change notification settings - Fork 9
Deploying BSIS
N.B. The commands below should not be run as root or with sudo. They should be run as a user who is a sudoer. At some point you might be prompted for your password or GitHub credentials.
-
The scripts may fail if the server that they are running on does not have enough memory. The Grunt and Maven builds are the steps which require the most memory. 2GB should be sufficient, but depending on what else is running you may need more than this. If you have less than 2GB you may need to set up swap https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04.
-
If you have already set up Tomcat and deployed BSIS you will need to remove the existing BSIS webapp from the Tomcat webapps directory. You can do this by running
rm -r /var/lib/tomcat7/webapps/bsis*. -
It is possible that Tomcat might hang during startup due to a lack of entropy in the system. If you run into this issue you can generate entropy by running the following commands:
sudo apt-get install rng-tools sudo rngd -r /dev/urandom
# Download
curl -sL https://raw.githubusercontent.com/jembi/bsis/master/infrastructure/deployment/env/provision.sh > provision-backend.sh
# Run
bash provision-backend.sh# Download
curl -sL https://raw.githubusercontent.com/jembi/bsis-frontend/master/infrastructure/deployment/env/provision.sh > provision-frontend.sh
# Run
bash provision-frontend.shEdit the config file and change the apiHost from localhost to the VM's IP address:
nano /opt/bsis-frontend/app/config/config.jsonExit nano with ctrl+x
# Download the update script
curl -sL https://raw.githubusercontent.com/jembi/bsis-frontend/master/infrastructure/deployment/env/update.sh > update-frontend.sh
# Run
bash update-frontend.shUpdating BSIS can be done by rerunning the setup steps above. The update scripts are just the same as the provision scripts with some commands removed so that they run faster for convenience.
Run the update script which was downloaded as part of the setup steps above:
bash update-frontend.shIf you want to deploy a different branch or tag you can pass the reference as the first parameter to the script e.g. bash update-frontend.sh my-branch.
# Download the update script
curl -sL https://raw.githubusercontent.com/jembi/bsis/master/infrastructure/deployment/env/update.sh > update-backend.sh
# Run
bash update-backend.shIf you want to deploy a different branch or tag you can pass the reference as the first parameter to the script e.g. bash update-backend.sh v1.0.
Email needs to be configured for the "Forgot Password" functionality to work. To configure the email settings follow the steps below:
Open the email.properties file located at /opt/bsis/src/email.properties for editing.
nano /opt/bsis/src/email.propertiesSet up the SMTP credentials that you have for sending emails. The simplest way to do this is to create a Gmail account and simply add the username and password for that account as the smtp.auth.username and smtp.auth.password properties respectively. Alternatively, if you use a different service for SMTP you will also need to update the smtp.host and smtp.port properties with the details that the service provides.
After editing the file the SMTP properties should look something like:
smtp.host=smtp.example.com
smtp.port=25
smtp.auth.username=example
smtp.auth.password=exampleP4ssw0rdOnce you have saved the file you will need to redeploy the backend so that the changes can take effect. This can be done by following the "Update the backend" steps above.