Nitrous.IO is a cloud-based development environment.
With Nitrous, you are able to write and store your application development online and access it on the go at shared office machines, on your iPad or Chromebook.
Another cool feature is the ability to work on files together via collaborative mode with other developers. In this mode, any changes and selections you make in your IDE get sent to the other people working with you.
As of this writing, Nitrous does not have native support for Grails. But you are able to build and run grails applications given that it provides a full linux command line.
In this post, I will show you how to build and deploy a Grails application on Nitrous.
First, you need a Nitrous account. If you’re thinking about it, you can get one by clicking on my referral link – https://www.nitrous.io/join/wz33AXVGTKs
Create a new box
Once you have logged in, you will need to provision a new box. Click on Boxes on the menu area and select a new box.
After a few minutes, you should see a brand new box provisioned for you. You should see a screen with an empty workspace as such:
Notice the console at the bottom. Unlike Cloud9, this is a full linux console.
You can also ssh to the box using your favourite client.
The next step is to get Grails installed in your local box. You can do this by using the GVM tool.
Type the following into the console:
curl -s get.gvmtool.net | bash source "/home/action/.gvm/bin/gvm-init.sh" gvm install grails
This should download the latest version of Grails.
Creating your application
In the console, type
grails create-app mySampleApp
this should create a full Application you can edit and play with.
Editing your Application
You should be able to refresh your workspace and see your grails application laid out. To edit your application, just click on the file you are interested in.
I found that you can get pretty far by selecting the file type to be Java.
Running your Application
To run your application, simply type in your console
Your grails application should run on port 8080. In the toolbar, you can click on Preview, which will lead you to an url like http://grailsbox-12954.euw1.actionbox.io:8080/ . You can either change your app context to / or add mySampleApp/ to your url ( http://grailsbox-12954.euw1.actionbox.io:8080/mySampleApp/ ) to see your running grails application.
The simplest way to do this is to pass in the right host and port number to your grails app:
grails -Dgrails.app.context='/' -Dgrails.server.port=8080 -Dgrails.server.host=0.0.0.0 run-app
One of the best features of Nitrous is the ability to collaboratively work on the same file with another person. You can use the toolbar to invite other users in the system to join your project.
This feature is best explained here – http://help.nitrous.io/collab/.
Running Functional Tests
One thing to note is that you might want to use a remote testing tool like Sauce Labs to see the results of your functional tests ran in this cloud environment.