Deployment instructions - UCLA-BD2K/metaprot GitHub Wiki
I would like to note that for now we will manually deploy WAR files to elastic beanstalk, but we should eventually: write a deployment script, or standardize deployment via Maven.
Before deploying a new application to Elastic beanstalk (ELB), there are a number of items you should check for.
- application.properties. You must have an application.properties file at
src/main/resources
with at least these fields filled out:
aws.access.key=...
aws.secret.access.key=...
aws.s3.bucketName=...
aws.dynamo.endpoint=...
task.scheduler.rserve.ports=...
app.r.script.location=@r-script-location@
-
src/main/resources/static/js/app.js. Set the appropriate Google Analytics tracking code for production (if necessary) to accurately keep track of site traffic.
-
ebextensions Check your project for a directory at src/main/resources/ebextensions. If it exists then you are set, else ask a local developer for a copy or retrieve it from one of the previously deployed packages on AWS Elastic Beanstalk.
Follow these steps to deploy the application to ELB:
- In the command line, navigate to the root directory of the project, where you can see
pom.xml
. - In your IDE/Text editor, navigate to pom.xml, and edit the packaging config to construct a WAR, as opposed to a JAR. The line should look like:
<packaging>war</packaging>
. - run
mvn clean
- run
mvn package -P <maven-profile-name>
, where<maven-profile-name>
is the profile name you chose for your production profile. - Assuming you have access to an AWS account and the application has been previously deployed to ELB, log into the online console and upload + deploy the WAR file as you would any other ELB application. If you are (re)creating a new ELB environment, then make sure to select Tomcat as the application environment. The other options are up to you but the default selections work just fine.
As a shortcut for the Maven commands, you can run mvn clean package -P <maven-profile-name>
.