11
CI/CD with OpenShift and Jenkins by Ari LiVigni, Michal Fojtik, and Aaron Weitekamp

CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

  • Upload
    leduong

  • View
    240

  • Download
    6

Embed Size (px)

Citation preview

Page 1: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

CI/CD with OpenShift and Jenkinsby Ari LiVigni, Michal Fojtik, and Aaron Weitekamp

Page 2: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

Agenda● Introduction and Goals● Jenkins Master/Slave Setup and Tools● CI/CD Workflow and Pipeline● Demo● Q&A

Page 3: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

Why Containers?● Speed● Agility (Cattle vs Pets)● Microservices are real● Ephemeral nature enforces persistent data volume● Portability / reproducibility

Page 4: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

Why OpenShift?● Run containers in cluster, DNS routing● Application blueprints (templatize microservices)● Integrated components and services: Builds,

Docker Registry, Jenkins and more...● Source-to-Image (S2I)

Page 5: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

● Generalize a container-based CI/CD pipeline1. Test every code change automatically2. Build image and promote manually3. Deploy to Stage 4. Deploy to Production

● Prevent promotion of broken builds

Goals

Page 6: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

Jenkins on OpenShift● Master / Slave● S2I allows customization of Jenkins image● Template to turn any builder image into a Jenkins

slave○ Slaves reach out to Jenkins and download JNLP Java agent○ Slave provides same environment as application runtime○ Slaves run as Pods and are started on-demand

Page 7: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

Jenkins Job Builder● Jenkins jobs defined locally as YAML templates,

uploaded as XML to any Jenkins Master ● Templating reduces redundancy in Jenkins jobs● Maintain YAML, not XML● Promotes source control management

Page 8: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

CI/CD Workflow/Pipeline

Page 9: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

Enough talkShow me the demo!

Page 10: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

Conclusion● Creating a custom CI/CD pipeline should be easy● Openshift Roadmap, release v3.3

○ Example https://github.com/arilivigni/openshift-ci-pipeline○ Openshift Jenkins Plugin

● Add Delivery Pipeline plugin to show visualization● Add more features to JJB for Promoted Build plugin

Page 11: CI/CD with OpenShift and Jenkins - Schedschd.ws/hosted_files/devconfcz2016/c2/CI-CD with OpenShift and... · CI/CD with OpenShift and Jenkins by Ari LiVigni, ... Jenkins Master/Slave

References● OpenShift CI

○ Openshift Jenkins https://github.com/openshift/jenkins

○ Example https://github.com/arilivigni/openshift-ci-pipeline

○ Vagrant quickstart https://www.openshift.org/vm/

○ Video https://youtu.be/IreIK-jICgY

● Jenkins Plugins

○ Promoted builds plugin https://wiki.jenkins-ci.

org/display/JENKINS/Promoted+Builds+Plugin

○ OpenShift pipeline pluginhttps://wiki.jenkins-ci.org/display/JENKINS/OpenShift+Pipeline+Plugin