kubernetes-operator/docs/developer-guide.md

1.9 KiB

Developer guide

This document explains how to setup your development environment.

Prerequisites

Clone repository and download dependencies

mkdir -p $GOPATH/src/github.com/VirtusLab
cd $GOPATH/src/github.com/VirtusLab/
git clone git@github.com:VirtusLab/jenkins-operator.git
cd jenkins-operator
make go-dependencies

Build and run

Build and run jenkins-operator` locally:

make build && make docker-build && 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/virtuslab_v1alpha1_jenkins_cr.yaml
kubectl get jenkins -o yaml
kubectl get po

Testing

Run unit tests:

make test

Run e2e tests with minikube:

make minikube-run
make docker-build-e2e
make e2e E2E_IMAGE=jenkins-operator

Hacks

pkg/apis/virtuslab/v1alpha1/jenkins_types has changed

Run:

make deepcopy-gen

Getting Jenkins URL and basic credentials

minikube service jenkins-operator-example --url
kubectl get secret jenkins-operator-credentials-example -o 'jsonpath={.data.password}' | base64 -d