Project for creating a Node.js 6 based Jenkins Slave container image (for use in OpenShift).
Build it yourself or try using the Dockerhub version (tag latest
is CentOS, tag rhel7-latest
is Red Hat E.Linux).
This is targeted towards OpenShift 3.7 and later, CentOS/RHEL7, and Node.js 6.
Assuming you already have an OpenShift cluster up and running and your Jenkins pipeline setup. You need to:
- Update the Jenkins Kubernetes plugin to reference the builder image. Open your Jenkins webconsole and in
Jenkins->Manage Jenkins->Configure System
. Then look inCloud->Kubernetes->Kubernetes Pod Template
. Depending on where your container image lives, the new setup should look something like this:
-
Update your pipeline to reference the correct slave image by name. Something like:
pipeline { agent { node { // spin up a node.js slave pod to run this build on label 'nodejs6' } } [THE STAGES AND STEPS...]
or with the older syntax:
node('nodejs6') { stage('build') { openshiftBuild(buildConfig: '${NAME}', showBuildLogs: 'true') } [OTHER STAGES...]
If you want to read more about the Jenkins slave builder images see below links.
For OpenShift Origin:
For the production version - OpenShift Container Platform:
The upstream official source for these images that eventually goes into OpenShift:
Upstream built image (which I think is currently nodejs8):