An operator-managed OpenShift Jenkins for OpenShift 4.x
To run the operator locally, you need to have your OpenShift clusters active by running either of these commands:
# This sets your active credentials in ~/.kube/config
oc login your-server -u your-user -p your-passwordor
export KUBECONFIG=/home/user/path/to/kubeconfig`Then run this command to run the operator:
make run-localFollow these steps to access the Jenkins web UI:
First, create the Jenkins custom resource (CR):
oc create -f deploy/crds/jenkins_ephemeral_v1alpha1_jenkins_cr.yaml
jenkins.jenkins.dev/example-jenkins createdSecond, identify the route to the Jenkins console:
oc get routes -o jsonpath='{range .items[*].spec}{"https://"}{.host}{end}{":443\n"}'
https://example-jenkins-jenkins-demo.apps.my-cluster.testcluster.openshift.com:443And then, navigate to the route in your browser. You will be redirected by Jenkins to log into the OpenShift console before the Jenkins console web UI is opened.
Creating a new project that defines a pipeline (for example, through a project's JenkinsFile) will automatically create a job and build in the Operator managed instance of Jenkins.
For example:
oc new-app https://github.com/waveywaves/nodejs-ex --context-dir openshift/pipelines