Jenkins Heroku Step war:部署成功,但构建失败

时间:2018-05-28 16:08:28

标签: jenkins heroku

我的jenkins在Windows上运行,我有一份工作,从git检出,然后执行mvn clean install,然后执行heroku-command

heroku war:deploy target\server-0.0.1-SNAPSHOT.war --app **APPNAME**

被执行。输出是:

Uploading server-0.0.1-SNAPSHOT.war
-----> Packaging application...
       - app: soccercomserver
       - including: webapp-runner.jar
       - including: target/server-0.0.1-SNAPSHOT.war
-----> Creating build...
       - file: slug.tgz
       - size: 18MB
-----> Uploading build...
       - success
-----> Deploying...
remote: 
remote: -----> heroku-deploy app detected
remote: -----> Installing JDK 1.8... done
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote: 
remote: -----> Compressing...
remote:        Done: 68.7M
remote: -----> Launching...
remote:        Released v10
remote:        https://soccercomserver.herokuapp.com/ deployed to Heroku
remote: 
-----> Done

但jenkins-job失败的消息

Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

我用Google搜索并发现在windows cmd中有类似errorlevel的内容。所以我试图弄清楚会发生什么,但是使用命令echo Errorlevel: %ERRORLEVEL%

我没有输出,我猜是因为CMD认为在它被执行之前就失败了。

有人可以给我一个提示吗?

谢谢和最诚挚的问候

1 个答案:

答案 0 :(得分:0)

尝试将此添加到您的命令

heroku war:deploy target\server-0.0.1-SNAPSHOT.war --app **APPNAME** --exit-code

它应该返回错误代码。

其他0的任何错误代码都会导致

  

构建步骤'执行Windows批处理命令'将构建标记为失败

解决方案

修复heroku的问题并确保你得到0或者如果你对现有的命令感到满意,那么只需运行另一个批处理命令,如虚拟命令,它将返回0,如

ver > nul
相关问题