OpenShift integrates quite nicely with the Jenkins pipelines.
The following plugin adds steps that directly interact with a given OpenShift Platform https://github.com/openshift/jenkins-plugin
OpenShift 3.4 supports Jenkins pipelines as build strategy. OpenShift then spins up a Jenkins master as a Pod and runs the pipeline on it. In this techlab the Jenkins master is already running.
-
Create a file named
pipeline.yml
with the following content, replacing<myusername>
with your user name.apiVersion: v1 kind: BuildConfig metadata: name: <myusername>-pipeline spec: runPolicy: Serial source: type: Git git: uri: https://github.com/<myusername>/jenkins-techlab ref: lab-13.1 strategy: type: JenkinsPipeline jenkinsPipelineStrategy: jenkinsfilePath: Jenkinsfile
-
Import it into OpenShift with:
oc create -f pipeline.yml
You can now see the pipeline in Jenkins as well as in OpenShift, including a visualization of the various stages.
Check out https://blog.openshift.com/openshift-3-3-pipelines-deep-dive/ for further infos.
End of Lab 17