grailstravis-cigrails-3.0.9

Grails: command not found with Travis-CI


I want to use Travis-CI with my Grails 3.0.9 app. For this I created a .travis.yml file:

language: groovy

jdk:
  - oraclejdk7

before_install:
 - curl -s get.sdkman.io | bash
 - source "$HOME/.sdkman/bin/sdkman-init.sh"
 - sdk install grails 3.0.9
 - sdk default grails 3.0.9

script: grails test-app --stacktrace

When the Travis-CI service wants to build my application, it ends up with this error:

$ export GRAILS_HOME=/home/travis/.sdkman/candidates/grails/3.0.9/
$ export PATH=$PATH:$GRAILS_HOME/bin
$ ./gradlew assemble
...
(downloading a lot of gradle dependencies)
...
BUILD SUCCESSFUL
$ grails test-app
/home/travis/build.sh: line 45: grails: command not found

So do I have to install Grails somehow else or is it because of a missing/wrong path variable?


Solution

  • I've found a working .travis.yml here:

    language: groovy
    
    jdk:
      - oraclejdk7
    
    before_install:
    - curl -s http://get.sdkman.io | bash
    - echo sdkman_auto_answer=true > ~/.sdkman/etc/config
    - source "/home/travis/.sdkman/bin/sdkman-init.sh"
    - sdk install grails 3.0.9
    
    script: grails test-app --stacktrace
    

    Update:

    Use get.sdkman.io since get.gvmtool.net doesn't work anymore.