How to trigger spinnaker CD pipeline from Jenkins CI pipeline
For this setup all configurations we would do using spinnaker halyard CLI
-
Enable Jenkins Master
hal config ci jenkins enable
-
Add Jenkins Master with any required name to Jenkins master list. Here I've used name "my-jenkins-master"
While running this command keep jenkins admin user token handy which is required to authentication
echo $APIKEY | hal config ci jenkins master add my-jenkins-master \ --address $BASEURL \ --username $USERNAME \ --password # api key will be read from STDIN to avoid appearing # in your .bash_history
-
To apply this change Re-deploy spinnaker
sudo hal deploy apply
-
Add Jenkins trigger in pipeline
- Create pipeline or In existing pipeline go to configurations
-
Add trigger
Type: Jenkins
Master: This drop down would show above added jenkins master - "my-jenkins-master"
Job: This drop down would show all jobs from jenkins, select the one with spinnaker pipeline trigger want to associate
Property File: I'll write another blog for this, how to use this option, but it's optional hence can be left blank.
- Now, as soon jenkins job will be finished successful, spinnaker pipeline will be triggered automatically.
Comments
Post a Comment