Skip to content

Instantly share code, notes, and snippets.

@ryangraffy
Created August 28, 2018 16:34
Show Gist options
  • Save ryangraffy/ab4f5878d4162134ec88f3d131c52d5b to your computer and use it in GitHub Desktop.
Save ryangraffy/ab4f5878d4162134ec88f3d131c52d5b to your computer and use it in GitHub Desktop.
Workaround to JENKINS-48960
Per https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console
https://issues.jenkins-ci.org/browse/JENKINS-48960?focusedCommentId=332057&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-332057
update.groovy:
--------------
for (f in Jenkins.instance.getAllItems(jenkins.branch.MultiBranchProject.class)) {
if (f.parent instanceof jenkins.branch.OrganizationFolder) {
f.addTrigger(new com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger("5m"));
}
}
update.sh:
----------
#!/bin/bash
mytoken=$(curl --user 'rgraffy:b2m97jHPp@#e' -s https://ci.recognation.com/crumbIssuer/api/json -k | python -c 'import sys,json;j=json.load(sys.stdin);print j["crumbRequestField"] + "=" + j["crumb"]')
curl --user 'rgraffy:b2m97jHPp@#e' -d "$mytoken" --data-urlencode "script=$(<./update.groovy)" https://ci.recognation.com/scriptText -k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment