Example of migration from fuse 6.3 standalone to fuse 7 on openshift, with metadata to create a jenkins pipeline on openshift to build and deploy the application.
Making the ansible slave and Jenkins in a cicd namespace in order to get pipelines working...
This is all using openshift applier, please view the items in .openshift
and .applier
in order to get an idea of what is happening in the pipeline, quite reliant on the jenkins-slave-ansible
that will be built below.
oc new-project dev
oc new-project release
oc new-project cicd
git clone https://github.com/redhat-cop/containers-quickstarts
cd containers-quickstarts/jenkins-slaves/jenkins-slave-ansible
oc process -f ../.openshift/templates/jenkins-slave-generic-template.yml -p NAME=jenkins-slave-ansible -p SOURCE_CONTEXT_DIR=jenkins-slaves/jenkins-slave-ansible | oc create -f -
# once the image is built
oc tag cicd/jenkins-slave-ansible:v3.11 cicd/jenkins-slave-ansible:latest
oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/jenkins-persistent-template.json -n openshift
oc new-app --template=jenkins-persistent
Surprisingly didn't need to do anything - it's auto configured..!
oc create secret generic github-secret --from-literal=username=yourusername --from-literal=password=12345678
Create the cicd-github-secret
in Jenkins with your GitHub credentials
oc policy add-role-to-user admin system:serviceaccount:cicd:jenkins -n dev
oc policy add-role-to-user admin system:serviceaccount:cicd:jenkins -n release
oc create -f sample-pipeline.yml
Once done, you should get a pipelines you can run from the Openshift web console.
This view will also be available via the traditional Jenkins build job in the persistent Jenkins you have created.
Can configure webhooks if available on the interwebs