[英]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.