Skip to content
SoheilSaif edited this page Dec 2, 2014 · 4 revisions

Welcome to the greenlight wiki!

Deploying

We recommend running production instances of Greenlight in Tomcat, and the following instructions are based around Tomcat. That said, Greenlight should run fine on any modern servlet container.

Pre-requisites

To build Greenlight you will need:

  • Java >1.6
  • Grails, at the version of the released app (1.0.x releases use Grails v2.3.7)
  • A Git client

To run Greenlight your server will need:

  • A Linux, Mac or Windows operating system
  • Tomcat 7 or later
  • Postgres 8 or later

Building a production WAR file

  1. Check out the required version (e.g. git checkout 1.2.3)
  2. Clean the repository with grails clean && grails clean-all
  3. Remove the web-app/attachments directory if it exists
  4. Run bower install from the project root (installs front-end dependencies)
  5. Build the WAR with grails prod war

The output of the build process is a file named greenlight-x.y.z.war in the target/ directory.

Deploying the Greenlight WAR

  1. Stop the running instance of Tomcat
  2. Backup the Postgres database
  3. Backup the content of Tomcat's webapps directory, specifically the Greenlight WAR and exploded WAR directory
  4. Check you've done steps 1, 2, and 3, because they're really important
  5. HONEST -- REALLY REALLY REALLY IMPORTANT
  6. Copy the new Greenlight WAR into the webapps directory and rename to greenlight.war
  7. Start Tomcat
  8. Wait to application comes back up. Go to step no. 12.
  9. If you have an existing system: Stop Tomcat
  10. Copy the contents of the 'Attachment' folder from your backup to the new 'Attachment' folder -- I told you it was important!
  11. Start Tomcat
  12. Test and rejoice -- probably ...

Deploying for the first time

If this is the first time you've deployed Greenlight you'll probably need to configure the database connection. This can be done in ~/.grails/greenlight-config.properties on Unix or <YOUR_HOME_DIRECTORY>\.grails\greenlight-config.properties for Windows. This file needs to contain the database credentials in the following format:

dataSource {
    url = "jdbc:postgresql://localhost:5432/greenlight"
    username = "postgres"
    password = "mysupersecuresecretpassword"
    driverClassName = "org.postgresql.Driver"
    dialect = org.hibernate.dialect.PostgreSQLDialect
}