|
| 1 | +# Tekton Pruner Official Release Cheat Sheet |
| 2 | + |
| 3 | +These steps provide a no-frills guide to performing an official release |
| 4 | +of Tekton Pruner. To follow these steps you'll need a checkout of |
| 5 | +the pruner repo, a terminal window and a text editor. |
| 6 | + |
| 7 | +1. [Setup a context to connect to the dogfooding cluster](#setup-dogfooding-context) if you haven't already. |
| 8 | + |
| 9 | +1. `cd` to root of Pruner git checkout. |
| 10 | + |
| 11 | +1. Make sure the release `Pipeline` is up-to-date on the cluster. |
| 12 | + |
| 13 | + - [pruner-release](https://github.com/tektoncd/pruner/blob/main/tekton/release-pipeline.yaml) |
| 14 | + ```shell script |
| 15 | + kubectl apply -f tekton/release-pipeline.yaml |
| 16 | + ``` |
| 17 | + |
| 18 | +1. Select the commit you would like to build the release from, most likely the |
| 19 | + most recent commit at https://github.com/tektoncd/pruner/commits/main |
| 20 | + and note the commit's hash. |
| 21 | +
|
| 22 | +1. Create environment variables for bash scripts in later steps. |
| 23 | +
|
| 24 | + ```bash |
| 25 | + VERSION_TAG=# UPDATE THIS. Example: v0.6.2 |
| 26 | + PRUNER_RELEASE_GIT_SHA=# SHA of the release to be released |
| 27 | + ``` |
| 28 | +
|
| 29 | +1. Confirm commit SHA matches what you want to release. |
| 30 | +
|
| 31 | + ```bash |
| 32 | + git show $PRUNER_RELEASE_GIT_SHA |
| 33 | + ``` |
| 34 | +
|
| 35 | +1. Create a workspace template file: |
| 36 | +
|
| 37 | + ```bash |
| 38 | + cat <<EOF > workspace-template.yaml |
| 39 | + spec: |
| 40 | + accessModes: |
| 41 | + - ReadWriteOnce |
| 42 | + resources: |
| 43 | + requests: |
| 44 | + storage: 1Gi |
| 45 | + EOF |
| 46 | + ``` |
| 47 | +
|
| 48 | +1. Execute the release pipeline. |
| 49 | +
|
| 50 | + **If you are back-porting include this flag: `--param=releaseAsLatest="false"`** |
| 51 | +
|
| 52 | + ```bash |
| 53 | + tkn --context dogfooding pipeline start pruner-release \ |
| 54 | + --param package=github.com/tektoncd/pruner \ |
| 55 | + --param repoName=pruner |
| 56 | + --param imageRegistry=ghcr.io \ |
| 57 | + --param imageRegistryPath=tektoncd/pruner \ |
| 58 | + --param imageRegistryRegions="" \ |
| 59 | + --param imageRegistryUser=tekton-robot \ |
| 60 | + --param gitRevision="${PRUNER_RELEASE_GIT_SHA}" \ |
| 61 | + --param versionTag="${VERSION_TAG}" \ |
| 62 | + --param serviceAccountImagesPath=credentials \ |
| 63 | + --param releaseBucket=tekton-releases \ |
| 64 | + --param koExtraArgs="" \ |
| 65 | + --workspace name=release-secret,secret=oci-release-secret \ |
| 66 | + --workspace name=release-images-secret,secret=ghcr-creds \ |
| 67 | + --workspace name=workarea,volumeClaimTemplateFile=workspace-template.yaml |
| 68 | + ``` |
| 69 | +
|
| 70 | +1. Watch logs of pruner-release. |
| 71 | +
|
| 72 | +1. Once the pipeline run is complete, check its results: |
| 73 | +
|
| 74 | + ```bash |
| 75 | + tkn --context dogfooding pr describe <pipeline-run-name> |
| 76 | +
|
| 77 | + (...) |
| 78 | + 📝 Results |
| 79 | +
|
| 80 | + NAME VALUE |
| 81 | + commit-sha 6ea31d92a97420d4b7af94745c45b02447ceaa19 |
| 82 | + release-file https://infra.tekton.dev/tekton-releases/pruner/previous/v0.13.0/release.yaml |
| 83 | + release-file-no-tag https://infra.tekton.dev/tekton-releases/pruner/previous/v0.13.0/release.notag.yaml |
| 84 | +
|
| 85 | + (...) |
| 86 | + ``` |
| 87 | +
|
| 88 | + The `commit-sha` should match `$PRUNER_RELEASE_GIT_SHA`. |
| 89 | + The two URLs can be opened in the browser or via `curl` to download the release manifests. |
| 90 | +
|
| 91 | +1. The YAMLs are now released! Anyone installing Tekton pruner will now get the new version. Time to create a new GitHub release announcement: |
| 92 | +
|
| 93 | +1. Create additional environment variables |
| 94 | +
|
| 95 | + ```bash |
| 96 | + PRUNER_OLD_VERSION=# Example: v0.11.1 |
| 97 | + TEKTON_PACKAGE=tektoncd/pruner |
| 98 | + ``` |
| 99 | +
|
| 100 | +1. Find the Rekor UUID for the release |
| 101 | +
|
| 102 | + ```bash |
| 103 | + RELEASE_FILE=https://infra.tekton.dev/tekton-releases/pruner/previous/${VERSION_TAG}/release.yaml |
| 104 | + CONTROLLER_IMAGE_SHA=$(curl $RELEASE_FILE | sed -n 's/"//g;s/.*ghcr\.io.*controller.*@//p;') |
| 105 | + REKOR_UUID=$(rekor-cli search --sha $CONTROLLER_IMAGE_SHA | grep -v Found | head -1) |
| 106 | + echo -e "CONTROLLER_IMAGE_SHA: ${CONTROLLER_IMAGE_SHA}\nREKOR_UUID: ${REKOR_UUID}" |
| 107 | + ``` |
| 108 | +
|
| 109 | +1. Execute the Draft Release task. |
| 110 | +
|
| 111 | + ```bash |
| 112 | + tkn --context dogfooding pipeline start \ |
| 113 | + --workspace name=shared,volumeClaimTemplateFile=workspace-template.yaml \ |
| 114 | + --workspace name=credentials,secret=oci-release-secret \ |
| 115 | + -p package="${TEKTON_PACKAGE}" \ |
| 116 | + -p git-revision="${PRUNER_RELEASE_GIT_SHA}" \ |
| 117 | + -p release-tag="${VERSION_TAG}" \ |
| 118 | + -p previous-release-tag="${PRUNER_OLD_VERSION}" \ |
| 119 | + -p release-name="Tekton Pruner" \ |
| 120 | + -p bucket="tekton-releases" \ |
| 121 | + -p rekor-uuid="$REKOR_UUID" \ |
| 122 | + release-draft |
| 123 | + ``` |
| 124 | +
|
| 125 | +1. Watch logs of create-draft-release. On successful completion, a URL will be logged. Visit that URL and look through the release notes. |
| 126 | + |
| 127 | +1. Manually add upgrade and deprecation notices based on the generated release notes. Double-check that the list of commits here matches your expectations |
| 128 | +for the release. You might need to remove incorrect commits or copy/paste commits |
| 129 | +from the release branch. Refer to previous releases to confirm the expected format. |
| 130 | +
|
| 131 | +1. Un-check the "This is a pre-release" checkbox since you're making a legit for-reals release! |
| 132 | +
|
| 133 | +1. Publish the GitHub release once all notes are correct and in order. |
| 134 | +
|
| 135 | +1. Edit `releases.md` on the `main` branch, add an entry for the release. |
| 136 | + - In case of a patch release, replace the latest release with the new one, |
| 137 | + including links to docs and examples. Append the new release to the list |
| 138 | + of patch releases as well. |
| 139 | + - In case of a minor or major release, add a new entry for the |
| 140 | + release, including links to docs and example |
| 141 | + - Check if any release is EOL, if so move it to the "End of Life Releases" |
| 142 | + section |
| 143 | +
|
| 144 | +1. Push & make PR for updated `releases.md` |
| 145 | +
|
| 146 | +1. Test release that you just made against your own cluster (note `--context my-dev-cluster`): |
| 147 | +
|
| 148 | + ```bash |
| 149 | + # Test latest |
| 150 | + kubectl --context my-dev-cluster apply --filename https://infra.tekton.dev/tekton-releases/pruner/latest/release.yaml |
| 151 | + ``` |
| 152 | +
|
| 153 | + ```bash |
| 154 | + # Test backport |
| 155 | + kubectl --context my-dev-cluster apply --filename https://infra.tekton.dev/tekton-releases/pruner/previous/v0.12.1/release.yaml |
| 156 | + ``` |
| 157 | +
|
| 158 | +1. For major releases, the [website sync configuration](https://github.com/tektoncd/website/blob/main/sync/config/pruner.yaml) |
| 159 | + to include the new release. |
| 160 | +
|
| 161 | +1. Announce the release in Slack channels #general, #pruner and #announcements. |
| 162 | +
|
| 163 | +Congratulations, you're done! |
| 164 | +
|
| 165 | +## Setup dogfooding context |
| 166 | +
|
| 167 | +1. Configure `kubectl` to connect to |
| 168 | + [the dogfooding cluster](https://github.com/tektoncd/plumbing/blob/main/docs/dogfooding.md): |
| 169 | +
|
| 170 | + ```bash |
| 171 | + oci ce cluster create-kubeconfig --cluster-id <CLUSTER-OCID> --file $HOME/.kube/config --region <CLUSTER-REGION> --token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT |
| 172 | + ``` |
| 173 | +
|
| 174 | +1. Give [the context](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/) |
| 175 | + a short memorable name such as `dogfooding`: |
| 176 | +
|
| 177 | + ```bash |
| 178 | + kubectl config rename-context <REPLACE-WITH-NAME-FROM-CONFIG-CONTEXT> dogfooding |
| 179 | + ``` |
| 180 | +
|
| 181 | +## Important: Switch `kubectl` back to your own cluster by default. |
| 182 | +
|
| 183 | +```bash |
| 184 | +kubectl config use-context my-dev-cluster |
| 185 | +``` |
0 commit comments