Jenkins
This is an older version of the document. To view the most recent version of the document, click here.
Steps to Configure Jenkins for Spinnaker
Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.
Using this CI system on Spinnaker, lets you trigger pipelines with Jenkins, add a Jenkins stage to your pipeline, or add a Script stage to your pipeline.
Prerequisites:
Below are the requirements to Connect Jenkins to Spinnaker
An active & stable Jenkins Master, should be reachable at a URL from the provider that Spinnaker will be deployed in.
User Credentials, able to authenticate against Jenkins using HTTP Basic Auth, if Jenkins is secured.
Steps to Add Jenkins Master to Spinnaker:
Ensure, to have Jenkins master to be enabled on Spinnaker
Now, add Jenkins master named my-jenkins-master to Spinnaker
Note
In case of using GitHub OAuth plugin for authentication into Jenkins, you can use the GitHub $USERNAME, and use the OAuth token as the $PASSWORD.
Upon, successful execution of the above commands re-deploy spinnaker
Configure Jenkins and Spinnaker for CSRF protection:
Note
CSRF is compatible only for Jenkins 2.x
To enable CSRF against Jenkins and Spinnaker, follow the below steps
Enable CSRF flag using Halyard
(MASTER is the name of the Jenkins master you’ve previously configured. If you haven’t yet added your master, use hal config ci jenkins master add instead of edit. )
Ensure to re-deploy Spinnaker to invoke changes
Enable CSRF protection on Jenkins
Login to Jenkins Console -> Manage Jenkins -> Configure Global Security, select Prevent Cross Site Request Forgery exploits.
Under Crumb Algorithm, select Default Crumb Algorithm
Next Steps
Upon Completion of above, Jenkins can be used in your pipelines in one of three ways:
As a pipeline trigger
Using the built-in Jenkins stage
Using the Script stage
Last updated