Sample CI/CD Operator - Medium article
This operator was created using Operator-SDK version 1.0.
Run the following bash script in your environment;
$ mkdir cicd-operator
$ cd cicd-operator
$ operator-sdk init --domain=cicd.com --repo=github.com/victorpaulo/cicd-operator
$ operator-sdk create api --group=cicd --version=v1alpha1 --kind=CIBuild --resource=true --controller=true
$ make docker-build docker-push IMG=kind-registry:5000/cicd-operator:v0.0.1
$ make deploy IMG=kind-registry:5000/cicd-operator:v0.0.1
$ ssh-keygen -t rsa -N "" -f mykey
#Import the mykey.pub in the GitHub or Bitbucket via web console preferences option.
#Github
$ ssh-keyscan github.com > /tmp/known_hosts
#Bitbucket
$ ssh-keyscan bitbucket.org > /tmp/known_hosts
# Creating the secret
$ kubectl create secret generic git-creds --from-file=ssh=mykey --from-file=known_hosts=/tmp/known_hosts
$ kubectl apply -f config/samples/cicd_v1alpha1_cibuild_ace.yaml
$ kubectl apply -f config/samples/cicd_v1alpha1_cibuild_go.yaml
$ kubectl apply -f config/samples/cicd_v1alpha1_cibuild_nodejs.yaml
$ kubectl apply -f config/samples/cicd_v1alpha1_cibuild_java.yaml
$ kubectl apply - validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.16.0/cert-manager.yaml