Here are my most used commands I use during development and deployment of Grails application which is running on Cloudbees.
Dependencies when changing BuildConfig
- It happens quite usually - you add a new dependency to BuildConfig and it is not visible in your code. This helps to load it. I am also using --include-source option to get jars (because I might be wondering what code is behind).grails refresh-dependencies --include-source
Testing during development
- I am not using integration tests. The are two reasons why. First, it is possible to mock everything. Second, integration tests requires context and it is time consuming when starting it up.dev test-app unit:
- I usually run only one specific unit test when developing a feature.
dev test-app unit: UserServiceTests
- From time to time I need to have more applications running at the same time (e.g. when doing an integration between client application, admin application and some web services).dev run-app -Dserver.port=8080
Validation before deploying war into the production
- At first, run all the tests. E.g. my web services written in Grails have 95% line coverage, applications about 80%. So I am quite confident when deploying it to production.test-app
- Simulate running the war on local machine. Running application by run-war might uncover some issues which could occur during deployment of war on cloud. It can happen that application is running well when it is started by run-app but it fails during deployment (which causes your production app is not available).run-war
- After the steps above are without problems then I make a production war file.prod war
- It is necessary to install CloudBees SDK so the applications can be deployed from command line.bees app:deploy myapp.war -a myaccount/myapplication
- This is how to restart application from command line... it is quite handy. bees app:restart myaccount/myapplication