Grails:Travis-CI找不到命令

时间:2015-12-05 19:06:40

标签: grails travis-ci grails-3.0.9

我想在我的Grails 3.0.9应用中使用Travis-CI。为此,我创建了一个.travis.yml文件:

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

当Travis-CI服务想要构建我的应用程序时,它最终会出现此错误:

$ 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

所以我必须以其他方式安装Grails,还是因为缺少/错误的路径变量?

1 个答案:

答案 0 :(得分:2)

我找到了有效的.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

<强>更新

使用get.sdkman.io,因为get.gvmtool.net不再有效。