- Create a GitHub account
- Setup GitHub access via SSH
- Create and checkout a repo fork
- Set up your shell environment
- Install requirements
- Set up a Kubernetes cluster
- Running Tests
Then you can iterate.
The Go tools require that you clone the repository to the
src/github.com/tektoncd/chains
directory in your
GOPATH
.
To check out this repository:
- Create your own fork of this repo
- Clone it to your machine:
mkdir -p ${GOPATH}/src/github.com/tektoncd
cd ${GOPATH}/src/github.com/tektoncd
git clone [email protected]:${YOUR_GITHUB_USERNAME}/chains.git
cd chains
git remote add upstream [email protected]:tektoncd/chains.git
git remote set-url --push upstream no_push
Adding the upstream
remote sets you up nicely for regularly
syncing your fork.
You must install these tools:
go
: The language Tekton Chains is built ingit
: For source controlkubectl
(optional): For interacting with your kube cluster
To setup a Kubernetes cluster for development, see the Tekton Pipelines documentation.
To build the Tekton Chains project, you'll need to set GO111MODULE=on
environment variable to force go
to use go
modules.
You can stand up a version of this controller on-cluster (to your kubectl config current-context
):
ko apply -f config/
As you make changes to the code, you can redeploy your controller with:
ko apply -f config/100-deployment.yaml
You can clean up everything with:
ko delete -f config/
To look at the controller logs, run:
kubectl -n tekton-chains logs deployment/tekton-chains-controller
Chains uses the standard go testing framework. Unit tests can be run with:
go test ./...
Integration tests require a running cluster and Chains to be installed. These are protected by a build tag "e2e". To run integration tests:
go test -v -count=1 -tags=e2e -timeout=20m ./test
Some of these tests require access to GCP resources. To run those, set the name of the GCP project you are running in:
GCP_PROJECT_ID=dlorenc-vmtest2 go test -v -count=1 -tags=e2e -timeout=20m ./test