|
| 1 | +# Tekton Pipelines Official Release Cheat Sheet |
| 2 | + |
| 3 | +This doc is a condensed version of our [tekton/README.md](./README.md) as |
| 4 | +well as instructions from |
| 5 | +[our plumbing repo](https://github.com/tektoncd/plumbing/tree/master/tekton/resources/release/README.md#create-draft-release). |
| 6 | + |
| 7 | +These steps provide a no-frills guide to performing an official release |
| 8 | +of Tekton Pipelines. To follow these steps you'll need a checkout of |
| 9 | +the pipelines repo, a terminal window and a text editor. |
| 10 | + |
| 11 | +1. `cd` to root of Pipelines git checkout. |
| 12 | + |
| 13 | +2. Point `kubectl` at dogfooding cluster. |
| 14 | + |
| 15 | + ```bash |
| 16 | + gcloud container clusters get-credentials dogfooding --zone us-central1-a --project tekton-releases |
| 17 | + ``` |
| 18 | + |
| 19 | +3. Edit `tekton/resources.yaml`. Add pipeline resource for new version. |
| 20 | + |
| 21 | + ```yaml |
| 22 | + apiVersion: tekton.dev/v1alpha1 |
| 23 | + kind: PipelineResource |
| 24 | + metadata: |
| 25 | + name: # UPDATE THIS. Example: tekton-pipelines-v0-11-2 |
| 26 | + spec: |
| 27 | + type: git |
| 28 | + params: |
| 29 | + - name: url |
| 30 | + value: https://github.com/tektoncd/pipeline |
| 31 | + - name: revision |
| 32 | + value: # UPDATE THIS. Example: 33e0847e67fc9804689e50371746c3cdad4b0a9d |
| 33 | + ``` |
| 34 | + |
| 35 | +4. `kubectl apply -f tekton/resources.yaml` |
| 36 | + |
| 37 | +5. Create environment variables for bash scripts in later steps. |
| 38 | + |
| 39 | + ```bash |
| 40 | + VERSION_TAG=# UPDATE THIS. Example: v0.11.2 |
| 41 | + GIT_RESOURCE_NAME=# UPDATE THIS. Example: tekton-pipelines-v0-11-2 |
| 42 | + IMAGE_REGISTRY=gcr.io/tekton-releases |
| 43 | + ``` |
| 44 | + |
| 45 | +6. Confirm commit SHA matches what you want to release. |
| 46 | + |
| 47 | + ```bash |
| 48 | + kubectl get pipelineresource "$GIT_RESOURCE_NAME" -o=jsonpath="{'Target Revision: '}{.spec.params[?(@.name == 'revision')].value}{'\n'}" |
| 49 | + ``` |
| 50 | + |
| 51 | +7. Execute the release pipeline. |
| 52 | + |
| 53 | + **If you are backporting include this flag: `--param=releaseAsLatest="false"`** |
| 54 | + |
| 55 | + ```bash |
| 56 | + tkn pipeline start \ |
| 57 | + --param=versionTag="${VERSION_TAG}" \ |
| 58 | + --param=imageRegistry="${IMAGE_REGISTRY}" \ |
| 59 | + --serviceaccount=release-right-meow \ |
| 60 | + --resource=source-repo="${GIT_RESOURCE_NAME}" \ |
| 61 | + --resource=bucket=pipeline-tekton-bucket \ |
| 62 | + --resource=builtBaseImage=base-image \ |
| 63 | + --resource=builtEntrypointImage=entrypoint-image \ |
| 64 | + --resource=builtKubeconfigWriterImage=kubeconfigwriter-image \ |
| 65 | + --resource=builtCredsInitImage=creds-init-image \ |
| 66 | + --resource=builtGitInitImage=git-init-image \ |
| 67 | + --resource=builtControllerImage=controller-image \ |
| 68 | + --resource=builtWebhookImage=webhook-image \ |
| 69 | + --resource=builtDigestExporterImage=digest-exporter-image \ |
| 70 | + --resource=builtPullRequestInitImage=pull-request-init-image \ |
| 71 | + --resource=builtGcsFetcherImage=gcs-fetcher-image \ |
| 72 | + --resource=notification=post-release-trigger \ |
| 73 | + pipeline-release |
| 74 | + ``` |
| 75 | + |
| 76 | +8. Watch logs of pipeline-release. |
| 77 | + |
| 78 | +9. The YAMLs are now released! Anyone installing Tekton Pipelines will now get the new version. Time to create a new GitHub release announcement: |
| 79 | + |
| 80 | + 1. Create TaskRun YAML file to execute create-draft-release Task. |
| 81 | + |
| 82 | + ```yaml |
| 83 | + apiVersion: tekton.dev/v1beta1 |
| 84 | + kind: TaskRun |
| 85 | + metadata: |
| 86 | + generateName: create-draft-release-run- |
| 87 | + spec: |
| 88 | + taskRef: |
| 89 | + name: create-draft-release |
| 90 | + params: |
| 91 | + - name: release-name |
| 92 | + value: # UPDATE THIS. Example: "Ragdoll Norby" |
| 93 | + - name: package |
| 94 | + value: tektoncd/pipeline |
| 95 | + - name: release-tag |
| 96 | + value: # UPDATE THIS. Example: v0.11.2 |
| 97 | + - name: previous-release-tag |
| 98 | + value: # UPDATE THIS. Example: v0.11.1 |
| 99 | + resources: |
| 100 | + inputs: |
| 101 | + - name: source |
| 102 | + resourceRef: |
| 103 | + name: # UPDATE THIS WITH PIPELINE RESOURCE YOU CREATED EARLIER. Example: tekton-pipelines-v0-11-2 |
| 104 | + - name: release-bucket |
| 105 | + resourceRef: |
| 106 | + name: # UPDATE THIS WITH BUCKET RESOURCE NAME FROM EARLIER. Example: tekton-release-bucket-pipeline |
| 107 | + ``` |
| 108 | + |
| 109 | + 2. Save as `create-draft-release-run.yaml` |
| 110 | + |
| 111 | + 3. Run Draft Release Task. |
| 112 | + |
| 113 | + ```bash |
| 114 | + kubectl create -f ./create-draft-release-run.yaml |
| 115 | + ``` |
| 116 | + |
| 117 | + 4. Watch logs of create-draft-release TaskRun for errors. |
| 118 | + |
| 119 | + ```bash |
| 120 | + tkn tr logs -f create-draft-release-run-# this will end with a random string of characters |
| 121 | + ``` |
| 122 | + |
| 123 | + 5. On successful completion, a URL will be logged. Visit that URL and sort the |
| 124 | + release notes. **Double-check that the list of commits here matches your expectations |
| 125 | + for the release.** You might need to remove incorrect commits or copy/paste commits |
| 126 | + from the release branch. Refer to previous releases to confirm the expected format. |
| 127 | + |
| 128 | + 6. Publish the GitHub release once all notes are correct and in order. |
| 129 | + |
| 130 | +10. Edit `README.md` on `master` branch, add entry to docs table with latest release links. |
| 131 | + |
| 132 | +11. Push & make PR for updated `README.md` |
| 133 | + |
| 134 | +12. **Important: Stop pointing `kubectl` at dogfooding cluster.** |
| 135 | + |
| 136 | + ```bash |
| 137 | + kubectl config use-context my-dev-cluster |
| 138 | + ``` |
| 139 | + |
| 140 | +13. Test release that you just made. |
| 141 | + |
| 142 | + ```bash |
| 143 | + # Test latest |
| 144 | + kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml |
| 145 | + ``` |
| 146 | + |
| 147 | + ```bash |
| 148 | + # Test backport |
| 149 | + kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.11.2/release.yaml |
| 150 | + ``` |
| 151 | + |
| 152 | +14. Announce the release in Slack channels #general and #pipelines. |
| 153 | + |
| 154 | +Congratulations, you're done! |
0 commit comments