Creating the pipeline
You are now ready to write your new pipeline that will take your source code, run testing and linting, build the image, push it to a registry, and do a rollout on your Kubernetes cluster. It might sound like a lot of work, but let's look at it step by step.
Start with a new file called pipeline.yaml
. In there, create a new pipeline named tekton-deploy
:
apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: tekton-deploy
In the spec
field, add the parameters and workspace that will be needed for your tasks:
spec: params: - name: repo-url - name: deployment-name - name: image - name: docker-username - name: docker-password workspaces: - name: source
Create your tasks
list and add a first task called clone
. This task refers to the git-clone
task...