Skip to content

Deployment instructions

almgong edited this page Sep 15, 2016 · 19 revisions

Deploying Metaprot

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.

Project checklist

Before deploying a new application to Elastic beanstalk (ELB), there are a number of items you should check for.

  • settings.xml OR pom.xml. You must have a Maven profile configuration with the correct value set for the r-script-location variable. For production (deployment to ELB), it should be equal to:
<profile>
   <id>profile-name</id>
   <properties>
      <r-script-location>webapps/ROOT/WEB-INF/classes/R/scripts/</r-script-location>
   </properties>
</profile>
  • 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=...

spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
db.mongo.dbname=metaprot

task.scheduler.rserve.ports=...
app.r.script.location=@r-script-location@ # from the Maven profile we set up
  • ebextensions Check your project for a directory at src/main/resources/ebextensions. If it exists then you are set, else ask one of the developers for a local copy.

Deploying

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 ', 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>

Clone this wiki locally