I started off with a very simple .travis.yaml file:
language: groovy jdk: - oraclejdk7 branches: only: - master script: ./grailsw refresh-dependencies && ./grailsw "test-app -integration"
When the build ran, I got an error message saying:
$ ./grailsw refresh-dependencies && ./grailsw "test-app integration:" /home/travis/build.sh: line 147: ./grailsw: Permission denied The command "./grailsw refresh-dependencies" exited with 126.
Scratching my head, I ran to Google. Unfortunately, there were absolutely no results for “travis grailsw permission denied”. It took another 20 minutes of searching related terms before I finally discovered the answer. Looks like Travis can get hung up on file permissions (even though I’m on Windows, and thus don’t really have “execute permissions”). The simple solution is to manually alter the permissions on the Grails wrapper:
language: groovy jdk: - oraclejdk7 branches: only: - master before_script: - chmod +x grailsw script: ./grailsw refresh-dependencies && ./grailsw "test-app -integration"
With that change in place, Travis builds and runs the tests successfully! Woo!
As a side note: once again, Grails astounds me. Look at that…I mean just LOOK at it! How much easier could it possibly be to add automatic CI builds to your Grails repository?! The answer is none. None more easier. 😉