MorphDeploy Plugin

  • Tags: utility, cloud, deployment
  • Latest: 0.1
  • Last Updated: 21 January 2009
  • Grails version: *
  • Authors: Marc Palmer
0 vote
Dependency:
compile ":morph-deploy:0.1"

 Documentation

Summary

Description

Mor.ph Deploy Plugin

This plugin prepares your WAR file for deployment to the Mor.ph scalable deployment platform service.

All you do is create a Mor.ph account, download the JAR + properties file from their site into the root directory of your grails project. Then install this plugin:

grails install-plugin morph-deploy

Once installed this will take care of the following for you:

  • The JNDI datasource will be set up in your web.xml
  • The JNDI mail session will be set up in your web.xml, and the mailsession and mailsender beans configured in resources.groovy (not tested use of this in app yet!)
  • The JDBC 2.0 extensions JAR will be REMOVED from your WAR when you run "grails war". This is required for correct Mor.ph deployment
The plugin provides a "deploy" script that will upload the latest version of your WAR to Mor.ph and deploy it. You can specify a different WAR name on the command line if you don't want this behaviour.

So to deploy your application to Mor.ph all you need to do is:

  1. In DataSource.groovy in the "production" environment, set it up like this:
production {
        dataSource { 
            driverClassName = 'com.mysql.jdbc.Driver'
            dbCreate = "update" 
            jndiName = "java:comp/env/jdbc/morph-ds" 
            dialect = 'org.hibernate.dialect.MySQLDialect'
        }
}

Obviously you make this change only once. If you are using POSTGRES, use the correct settings for it, as found in the Java cookbook on the Mor.ph website

2. Run: grails war

3. Run: grails deploy

When prompted, enter your Morph account username and password and wait while it uploads and automatically deploys your application!