简体   繁体   English

MSDeploy ERROR_SITE_DOES_NOT_EXIST不会使Jenkins作业失败

[英]MSDeploy ERROR_SITE_DOES_NOT_EXIST does not fail Jenkins job

We have a Jenkins Pipeline job setup to use MSDeploy to deploy to our dev environment. 我们有一个Jenkins Pipeline作业设置,可以使用MSDeploy部署到我们的开发环境。 We have a groovy file checked into source control that runs the deployment of several different applications. 我们已将一个常规文件检入源代码管理中,该文件可运行多个不同应用程序的部署。 Each application then downloads and calls this file. 然后,每个应用程序都下载并调用此文件。 When MSDeploy encounters an error such as Error Code: ERROR_USER_NOT_ADMIN, the job fails as expected. 当MSDeploy遇到诸如错误代码:ERROR_USER_NOT_ADMIN的错误时,作业将按预期失败。 If someone fat fingers the "IIS Web Application Name" in the SetParameters.xml file, you can see the error in the Jenkins Logs 如果有人不满SetParameters.xml文件中的“ IIS Web应用程序名称”,则可以在Jenkins日志中看到错误

15:55:36 Error Code: ERROR_SITE_DOES_NOT_EXIST
15:55:36 More Information: Site 'dev.mysite.com1' does not exist.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SITE_DOES_NOT_EXIST.
15:55:36 Error count: 1.
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

but the job still exists as successful. 但这项工作仍然成功。

Excerpt from Pipeline Job Groovy: 摘自Pipeline Job Groovy:

Stages = load "DeployTo_Test.Groovy"
Stages.Deploy(DROP_FOLDER, PROJECT_NAME, VER_DEPLOY_TO)

Excerpt from DeployTo_Test.Groovy 摘自DeployTo_Test.Groovy

def Deploy(DROP_FOLDER, PROJECT_NAME, VER_DEPLOYMENT_LOCATION) {
    ...SetSomeValues
    bat "pushd  ${COMMAND_LOC_TO_RUN}  && ${PROJECT_NAME}.deploy.cmd /Y /M:${deploymentMachines[i]} /U:%DeployUsername% /P:%DeployPassword% -setParamFile:%workspace%\\${SetParamFile}"
}

Logs from a different MSDeploy error that fails the job 来自另一个导致作业失败的MSDeploy错误的日志

16:16:48 Error Code: ERROR_USER_NOT_ADMIN
16:16:48 More Information: Connected to 'myMachine.com' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'myMachine.com'.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
16:16:48 Error: The remote server returned an error: (401) Unauthorized.
16:16:48 Error count: 1.
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -1
Finished: FAILURE

Why does Jenkins\\MSDeloy bat command exit successful with ERROR_SITE_DOES_NOT_EXIST and how do I get it to fail on this error like it does on the other? 为什么Jenkins \\ MSDeloy bat命令成功退出并出现ERROR_SITE_DOES_NOT_EXIST,如何使它像其他情况一样在此错误上失败?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么批处理文件执行仅在 Jenkins 中失败并显示压缩的 .rar 文件不存在的错误消息? - Why does batch file execution fail ONLY IN Jenkins with error message that compressed .rar file doesn't exist? 为什么这个 Groovy 脚本在 Jenkins 中无法获取作业参数? - Why does this Groovy script fail in Jenkins to get the job parameters? 蚂蚁 <javac> Jenkins中的“程序包不存在”错误 - Ant <javac> “package does not exist” error in Jenkins 仅在不存在文件夹的情况下,才可以执行aws s3 cp,否则作为我的詹金斯工作的一部分抛出错误? - How can I do aws s3 cp only if a folder does not exist, throw error otherwise as a part of my jenkins job? Hudson / jenkins不会因错误而失败 - Hudson/jenkins does not fail on errors “错误:文件‘DIAWI_LINKS’不存在”Jenkins Android - “ERROR: File 'DIAWI_LINKS' does not exist” Jenkins Android 为什么Jenkins作业在CloudBees上失败并显示“ Server.InternalError-不支持的部署类型:zip”? - Why does Jenkins job fail with “Server.InternalError - Deployment type not supported: zip” on CloudBees? Jenkins Maven 当声纳不符合质量门时作业应该失败 - Jenkins Maven Job should fail when Sonar does not meet quality gate 错误:文件“filename.diawilink”不存在 jenkins android - ERROR: File 'filename.diawilink' does not exist jenkins android 在詹金斯让工作失败 - Making a job fail in jenkins
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM