Skip to content
Philip Yurchuk edited this page Nov 16, 2013 · 15 revisions

Juggernaut is an OCJUG community project to build a new site on Grails 2.0.1. Our DB will be Postgres 9 and we will probably deploy to Cloud Foundry. Obviously, Git will be used for version control.

Participating

If you are in Orange County, CA, you can come to our meetings. The OCJUG meets the second Thursday of each month at 6:30PM at TEKsystems in Irvine. In addition, for collaboration/discussion/support we have a Google Group:

Google Groups
Subscribe to OCJUG Labs
Email:
Visit this group

All OCJUG members are invited to participate in this project, and below you will find the necessary steps to keep up.

Learn Git

Read Pro Git online for free. Really, chapters 2 and 3 should get you what you need. There is no shortcut for this and you'll be lost without this basic knowledge. You cannot leverage your SVN knowledge and just wing it like you did with CVS when learning SVN - there is a learning curve. Trust us, we learned this the hard way in our first meeting.

Our workflow is to create a local topic branch for each issue with the naming convention <issue #>-, e.g., 3-madeupname. When it's locally tested, you can push it to origin and create a pull request.

Set Up Your Environment

If you run into trouble with any of this, come to the meeting and we'll help you (but we still can't talk you through all the Git reading from above).

Our development environment is STS 2.9 or later, which includes Egit. When you install it, uncheck the box to install tc server, it's unnecessary. To install Grails support:

  1. Help >> Dashboard
  2. Click Extensions tab
  3. Add Grails extension

If you're new to Eclipse/STS, go through the overview and tutorials. Also, now is a good time to find where Grails itself was installed (should be alongside STS) and add its bin/ directory to your system's path environment variable. That will give you access to the Grails command line tool.

Once it's installed, give it a test drive. Create a new Grails app, then from the context menu, choose Run As... >> Grails Command (run-app). Surf to http://localhost:8080 and see what you've got.

If you want to use Egit in STS to manage your repository/working directory, start reading the Egit docs. They thoughtfully included a github tutorial. Note that I could not get the ssh protocol to work; I got persistent complaints regarding the passphrase, but no request for one, and removing it did not help. After much Googling and headbanging, I ended up switching to https and it worked like a charm on the first try. Note that this is only for Egit; on the command line github's ssh test passed without problem.

Next, get an account on github (yes, this site) and follow the docs to set up Git on your machine (either theirs or Egit's). Then, you can import the project via Egit. Note that because the .project and .classpath files were included, you can import this as an existing project, but you then have to fix the paths in them. After importing the project, right click on the project and select Grails >> Refresh Dependencies, then restart STS. That should clear up any errors.

Groovy and Grails

For the Cliff's Notes on Groovy, you can just read the style guide. If you're new to both Java and Groovy, there's a lengthier intro. Those pages have links to the full docs when you want to explore further.

Then it's on to the Grails docs, where creating an application is a good place to start. Note that there is the main table of contents, then the reference content links on the right of the page.

Postscript

Command Line
The command line (/bin/grails) is a powerful tool. Unfortunately, the version embedded in STS (both the popup and the wizard) don't seem to have proper tab completion, which is a big win. It also doesn't work properly under Cygwin. This may just be my machine, but if you're having the same issues, just run it from the Windows command prompt.

Adding Git
If you want to add git to an existing Grails project (not this one! one you've created on your own), you can run the command:

grails -integrate-with --git

This will create a .gitignore file, although I had to add the following to mine:

/target-eclipse/

If you don't want to add Eclipse project files, add this as well:

.classpath
.project

Clone this wiki locally