Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post-receive Script Update to use API Key instead of Crumb #10

Open
BatteryRage opened this issue Feb 11, 2022 · 0 comments
Open

post-receive Script Update to use API Key instead of Crumb #10

BatteryRage opened this issue Feb 11, 2022 · 0 comments

Comments

@BatteryRage
Copy link

Update course content to change the post-receive file from using crumbs to using an API-key.

Change the code in post-receive from this:
crumb=$(curl -u "jenkins:1234" -s 'http://jenkins:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)')
curl -u "jenkins:1234" -H "$crumb" -X POST http://jenkins:8080/job/maven-job/build?delay=0sec

To this:
curl -v -X POST http://jenkins:8080/job/maven-job/build?delay=0sec --user jenkins:<INSERT_API_KEY_HERE>

This works better with newer versions of Jenkins' default system settings because improved CSRF protection was implemented in version 2.176.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant