-
Notifications
You must be signed in to change notification settings - Fork 3
Home
SoheilSaif edited this page Dec 2, 2014
·
4 revisions
Welcome to the greenlight wiki!
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.
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
- Check out the required version (e.g.
git checkout 1.2.3
) - Clean the repository with
grails clean && grails clean-all
- Remove the
web-app/attachments
directory if it exists - Run
bower install
from the project root (installs front-end dependencies) - 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.
- Stop the running instance of Tomcat
- Backup the Postgres database
- Backup the content of Tomcat's
webapps
directory, specifically the Greenlight WAR and exploded WAR directory - Check you've done steps 1, 2, and 3, because they're really important
- HONEST -- REALLY REALLY REALLY IMPORTANT
- Copy the new Greenlight WAR into the
webapps
directory and rename togreenlight.war
- Start Tomcat
- Wait to application comes back up. Go to step no. 12.
- If you have an existing system: Stop Tomcat
- Copy the contents of the 'Attachment' folder from your backup to the new 'Attachment' folder -- I told you it was important!
- Start Tomcat
- Test and rejoice -- probably ...
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
}