简体   繁体   English

启用安全性后未触发Jenkins下游作业

[英]Jenkins downstream jobs not triggered after enabling security

I currently have two jenkins freestyle jobs setup. 我目前有两个jenkins自由式作业设置。 One is titled AutomatedBackup, and the other AutomatedBackupCleanup. 一个标题为AutomatedBackup,另一个标题为AutomatedBackupCleanup。 Upon successful completion of the AutomatedBackup job, the AutomatedBackupCleanup job is triggered. 成功完成AutomatedBackup作业后,将触发AutomatedBackupCleanup作业。

I have recently enabled security on my Jenkins instance, which appears to have broken the trigger between the two jobs. 我最近在我的Jenkins实例上启用了安全性,该实例似乎破坏了两个作业之间的触发条件。 The console output from the AutomatedBackup job looks like so: AutomatedBackup作业的控制台输出如下所示:

Started by user Chuck Norris
Running as Chuck Norris
Building on master in workspace /var/lib/jenkins/jobs/AutomatedBackup/workspace
[workspace] $ /bin/sh -xe /tmp/hudson8177383812364662730.sh
+ cp -a /var/lib/jenkins /opt/jenkinsbackups
+ cd /opt/jenkinsbackups
+ date +%Y%m%d-%H%M%S
+ tar czf jenkinsBackup_20170712-153210.tar.gz jenkins/

+ rm -rf /opt/jenkinsbackups/jenkins/

+ git add --all

+ git commit -m Jenkins Automated Backup
[master 50d9f46] Jenkins Automated Backup
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 jenkinsBackup_20170712-153210.tar.gz
+ git push

To ssh://git@178.70.84.195:7999/at/jenkinsbackup.git
   cea558b..50d9f46  master -> master
Running as anonymous cannot even see AutomatedBackup for trigger from AutomatedBackupCleanup
Finished: SUCCESS

I'm not sure what may be causing this. 我不确定是什么原因造成的。 It looks like the build is both started and run as my user, however the console output reports that: 看起来该构建既已启动又以我的用户身份运行,但是控制台输出报告:

Running as anonymous cannot even see AutomatedBackup for trigger from AutomatedBackupCleanup

Thanks in advance for any direction or steps that would be helpful in resolving this issue! 在此先感谢您提供解决此问题的任何方向或步骤!

I discovered the root cause of this issue and would like to leave some information here for those who may stumble across this issue in the future. 我发现了此问题的根本原因,并希望为那些将来可能会偶然发现此问题的人提供一些信息。

The issue appears to be that the AutomatedBackupCleanup job was set in its' configuration to build only after the AutomatedBackup job completed successfully. 问题似乎在于,只有在AutomatedBackup作业成功完成后,才将AutomatedBackupCleanup作业设置为其配置,以进行构建。 What I had to do instead, was add a post build action to the AutomatedBackup job to trigger the build of another project (and specified the AutomatedBackupCleanup job). 我要做的是向AutomatedBackup作业中添加一个后构建操作,以触发另一个项目的构建(并指定了AutomatedBackupCleanup作业)。

Hope this helps! 希望这可以帮助!

You don't need to add a post build action, the reason is that anonymous users cannot see builds. 您不需要添加构建后操作,原因是匿名用户看不到构建。 Go to Manage Jenkins > Configure Global Security, scroll down to Access Control - Authorization, then check the 'Job > Read' box for Anonymous. 转到“管理Jenkins”>“配置全局安全性”,向下滚动到“访问控制-授权”,然后选中“作业>读取”框以显示“匿名”。 It should allow other jobs to be triggered. 它应该允许其他作业被触发。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM