【问题标题】:Jenkins Heroku Step war:deploy success, but build failedJenkins Heroku Step war:部署成功,但构建失败
【发布时间】:2018-05-28 16:08:28
【问题描述】:

我的 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 在执行之前认为它是失败的。

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

感谢和最好的问候

【问题讨论】:

    标签: jenkins heroku


    【解决方案1】:

    尝试将此添加到您的命令中

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

    它应该返回错误代码。

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

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

    解决方案

    解决 heroku 的问题并确保您得到 0,或者如果您对现有命令感到满意,然后只需运行另一个批处理命令,如一个虚拟命令,它将返回一个 0,如

    ver > nul
    

    【讨论】:

      猜你喜欢
      • 2020-12-29
      • 2017-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-05
      • 1970-01-01
      • 2012-02-27
      • 1970-01-01
      相关资源
      最近更新 更多