Tools
Required tools for building and running Jenkins Operator
This document explains how to setup your development environment.
mkdir -p $GOPATH/src/github.com/jenkinsci
cd $GOPATH/src/github.com/jenkinsci/
git clone git@github.com:jenkinsci/kubernetes-operator.git
cd kubernetes-operator
make go-dependenciesBuild and run jenkins-operator locally:
make minikube-run EXTRA_ARGS='--minikube --local'Once minikube and jenkins-operator are up and running, apply Jenkins custom resource:
kubectl apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml
kubectl get jenkins -o yaml
kubectl get poYou can also run the controller locally and make it listen to a remote Kubernetes server.
make run NAMESPACE=default KUBECTL_CONTEXT=remote-k8s EXTRA_ARGS='--kubeconfig ~/.kube/config'Once minikube and jenkins-operator are up and running, apply Jenkins custom resource:
kubectl --context remote-k8s --namespace default apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml
kubectl --context remote-k8s --namespace default get jenkins -o yaml
kubectl --context remote-k8s --namespace default get poRun unit tests:
make testRun e2e tests with minikube:
make minikube-start
eval $(minikube docker-env)
make build e2eRun the specific e2e test:
make build e2e E2E_TEST_SELECTOR='^TestConfiguration$'At first, you need to start minikube:
$ make minikube-start
$ eval $(minikube docker-env) Build Docker image inside provided Linux container by:
$ make indockerBuild jenkins-operator inside container using:
$ make buildThen exit the container and run:
make e2e
To be able to work with the docker daemon on minikube machine run the following command before building an image:
eval $(minikube docker-env)pkg/apis/jenkinsio/*/jenkins_types.go has changedRun:
make deepcopy-genminikube service jenkins-operator-http-<cr_name> --url
kubectl get secret jenkins-operator-credentials-<cr_name> -o 'jsonpath={.data.user}' | base64 -d
kubectl get secret jenkins-operator-credentials-<cr_name> -o 'jsonpath={.data.password}' | base64 -dRequired tools for building and running Jenkins Operator