我有一个jenkins工作,它在作业执行shell中配置了5个构建脚本。现在我在脚本#1中有一个标志,如果它是假的,那么我不想运行剩余的4个构建脚本并直接退出然后构建结果应该通过。
但是现在即使在检查脚本#1标志为false之后它将从脚本#1退出并执行剩余的4个构建脚本,然后由于与脚本#1的依赖性而导致所有4个脚本都失败,最终我的jenkins构建状态失败。
我想在检查脚本#1之后可以退出工作并且直接jenkins工作状态应该是“通过”
jenkins本身有没有控制这种流动?没有在脚本中编写任何代码?
詹金斯错误:
------------
23:37:16 Nothing to build
23:37:16 SRV_SKIP_UNNECESSARY_BUILDS is set to 1
23:37:16 Exiting now...
23:37:16 +++/usr/atria/bin/cleartool rmview -f -tag swrel_sre_icx_test_ashok_diffreportvu_20180118_233612
23:37:30 SRE_FYI: No rebuild necessary for sre_icx_test_ashok since previous full build[EnvInject] - Injecting environment variables from a build step.
23:37:30 [EnvInject] - [ERROR] - The given properties file path '/var/tmp/jenkins/workspace/Test/sre_icx_test_ashok/srv_env_strip' doesn't exist.
23:37:30 [EnvInject] - [ERROR] - Missing file path was resolved from pattern '${WORKSPACE}/srv_env_strip' .
23:37:30 [EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build step: java.io.IOException: remote file operation failed: /var/tmp/jenkins/workspace/Test/sre_icx_test_ashok at hudson.remoting.Channel@1c0be696:l42-up-ecbld-01: java.io.IOException: The given properties file path '/var/tmp/jenkins/workspace/Test/sre_icx_test_ashok/srv_env_strip' doesn't exist.
23:37:30 Build step 'Inject environment variables' changed build result to FAILURE
23:37:30 Build step 'Inject environment variables' marked build as failure
23:37:30 Set build name.
23:37:30 Unrecognized macro 'SRV_BUILD_LABEL' in '#22 - ${SRV_BUILD_LABEL}'
23:37:30 Archiving artifacts
23:37:30 SSH: Current build result is [FAILURE], not going to run.
23:37:30 [description-setter] Description set: ${SRV_BUILD_DIR}
23:37:30 Notifying upstream projects of job completion
23:37:30 Finished: FAILURE
答案 0 :(得分:0)
理论上,你可以通过获取名为"失败的构建"的Jenkins插件来实现这一目的。并改变你的工作,以便:
我没有试过这个,看看它是否真的有用。