The Jenkins image for OISO Tenants and https://jenkins.cd.test.fabric8.io.
we broke the plugin update after changes due to openshiftio/openshift.io#2612 Hence introduce new way to update plugins.
- Once you modified plugin.txt or added any .jpi/hpi in plugins folder
- Please run the script update-version.sh, it will just update the version.txt to next increamental number.
- git add version.txt
- commit this change with the PR required for upating the plugin
- Get the latest s2i
- Run the following in the default namespace as explained in the todo below
Run the following steps to build and deploy this customised OpenShift Jenkins Pipeline image..
# modify the existing OpenShift Jenkins image adding Pipeline plugins and configuration
s2i build https://github.com/fabric8io/openshift-jenkins-s2i-config.git openshift/jenkins-1-centos7 fabric8/jenkins-openshift-pipeline:latest
oc new-app -f https://raw.githubusercontent.com/rawlingsj/openshift-jenkins-s2i-config/master/jenkins-template.yml -p JENKINS_PASSWORD=admin
# expose the Jenkins service as you would normally e.g.
oc expose service jenkins --hostname=jenkins.vagrant.f8
Access Jenkins via your OpenShift route, admin/admin
to log in.
You will have an example pipeline job already created that you can run. Also the configuration for kubernetes-plugin will have been setup automatically. You can see in the Job configuration which it references a Jenkinsfile in another repo, this is the recommended approach where a Jenkinsfile lives with the source code. The Jenkinsfile uses the agent
node label which requests a new Kubernetes Pod to be scheduled to run our basic stages.
Example basic Jenkinsfile..
node('agent'){
stage 'first'
echo 'worked'
stage 'second'
echo 'again'
}
-
Pipeline plugin ability to run Jenkinsfile
-
Pipeine stage view plugin useful visualisations
-
Kubernetes plugin dynamically create Jenkins Agents on demand
-
Remote loader allows loading Pipeline scripts from remote locations. Note until global library is versioned this is what we're suggesting users use to ensure reusable functions are versioned.
-
Pipeline Utility Steps Plugin useful library for working with Jenkinsfiles
-
Mercurial to support mercurial but we've not tested this
-
Github branch source plugin still not too sure about this one, it sounds good but its usability is a little raw. For example, it will automatically trigger any new job that gets created after a repo scan which is a little scary.
-
Simple build pipeline it didn't work for me but it looks promising in the future
It is really hard to update plugins correctly, you can get backward compatibility problems really easy.
First run (probably it is already deployed in OpenShift) the Jenkins instance you want to update from. Go to Manage Jenkins, Manage Plugins and update the plugins you need for next version.
After Jenkins is updated and you restart it, go to Manage Jenkins, Script Console and run next script:
Jenkins.instance.pluginManager.plugins.each{
plugin ->
println ("${plugin.getShortName()}:${plugin.getVersion()}")
}
Then just inspect the result and update the plugins.txt
file properly.
- Update jenkins tenant configmap to add new or update existing plugin configuration
You'll need to expose the Jenkins JNLP port and create a separate agent service like this example
- This example is currently hard coded to run in the default namespace at the moment. I had a go at using a
KUBERNETES_NAMESPACE
env var as per the fabric8 version which is set and available in the container but I ran into an issue starting the agent pod, so it needs to be looked at again. - Add the SNAPSHOT openshift-jenkins-sync-plugin to this project