Grails: command not found with Travis-CI

最后都变了- 提交于 2019-12-11 11:30:17

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/34109659/grails-command-not-found-with-travis-ci

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!