From 350675000cf8784ba9a510effc78dfafe3f481a8 Mon Sep 17 00:00:00 2001 From: Simon Baird Date: Mon, 23 Sep 2024 14:38:18 -0400 Subject: [PATCH] Revise the "cut release" script - Remove scripts to apply patches from main branch pipelines to the new pipelines. - Describe the new plan, which is to just use the main branch pipelines instead of merging in the pipelines from the PR that Konflux creates. - Describe how to make a PR in tenants-config to create the application, component, etc. (Note that we've never done it this way before, so it's a little speculative.) - Add a couple of steps that were previously not listed. - Various other changes along those lines. Ref: https://issues.redhat.com/browse/EC-819 --- hack/cut-release.sh | 172 +++++++++++--------------------- hack/patch-release-pipelines.sh | 105 ------------------- 2 files changed, 60 insertions(+), 217 deletions(-) delete mode 100755 hack/patch-release-pipelines.sh diff --git a/hack/cut-release.sh b/hack/cut-release.sh index 2e62329f5..97805d751 100755 --- a/hack/cut-release.sh +++ b/hack/cut-release.sh @@ -21,14 +21,14 @@ set -o pipefail CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) if [[ $CURRENT_BRANCH != "main" ]]; then - echo "Expecting to be in main branch!" - exit 1 + read -r -p "Not in main branch. Continue anyway? [y/N] " ans + [[ "$ans" != "y" ]] && exit 1 fi RELEASE_NAME="v$(cat VERSION)" if [[ $RELEASE_NAME != *.* || $RELEASE_NAME == *.*.* ]]; then - echo "Release name should include one dot, e.g. v0.5 or v1.1-candidate" - exit 1 + echo "Release name should include one dot, e.g. v0.5 or v1.1-candidate" + exit 1 fi # Use release name as-is for the branch name @@ -37,7 +37,6 @@ BRANCH_NAME="release-${RELEASE_NAME}" # Konflux disallows . chars in names so remove those KONFLUX_APPLICATION_SUFFIX="${RELEASE_NAME/./}" -# Could be whatever, but let's adopt a consistent convention KONFLUX_APPLICATION_NAME=ec-${KONFLUX_APPLICATION_SUFFIX} KONFLUX_CLI_COMPONENT_NAME=cli-${KONFLUX_APPLICATION_SUFFIX} @@ -47,10 +46,8 @@ echo Release branch name: $BRANCH_NAME echo Konflux application name: $KONFLUX_APPLICATION_NAME echo Konflux cli component name: $KONFLUX_CLI_COMPONENT_NAME -KONFLUX_APPS_URL=https://console.redhat.com/preview/application-pipeline/workspaces/rhtap-contract/applications - nice_title() { - echo -e "\033[1m» $*\033[0m" + echo -e "\033[1m» $*\033[0m" } # Explain what needs to be done next @@ -65,126 +62,64 @@ git fetch upstream git push upstream refs/remotes/upstream/main:refs/heads/${BRANCH_NAME} git checkout -b ${BRANCH_NAME} upstream/${BRANCH_NAME} -$(nice_title Create new application in Konflux) +$(nice_title Create a PR in for konflux-release-data) -Login at ${KONFLUX_APPS_URL} -Click "Create application" - Application name: ${KONFLUX_APPLICATION_NAME} -Click "Add component" - Git repository url: https://github.com/enterprise-contract/ec-cli - Git reference: ${BRANCH_NAME} (under "Advanced Options") - Dockerfile: Dockerfile.dist - Component name: ${KONFLUX_CLI_COMPONENT_NAME} - Pipeline: docker-build -Click "Create application" to submit +This repo: https://gitlab.cee.redhat.com/releng/konflux-release-data/ +This directory: tenants-config/cluster/stone-prd-rh01/tenants/rhtap-contract-tenant/ -$(nice_title Wait for Konflux to generate its pipeline definition PR) +Copy overlays/ec-v06 to overlays/${KONFLUX_APPLICATION_NAME} -The PR should appear at https://github.com/enterprise-contract/ec-cli/pulls -Wait for the PR to pass the ${KONFLUX_CLI_COMPONENT_NAME}-on-pull-request check -You can also find the pipeline run at ${KONFLUX_APPS_URL}/${KONFLUX_APPLICATION_NAME}/activity/pipelineruns -When it's done you can merge, or you can leave it unmerged and push more commits to it shortly. -(Either way you can continue to next section while you're waiting.) +Edit overlays/${KONFLUX_APPLICATION_NAME}/kustomization.yaml as required. +Useful vimdiff command: + vimdiff overlays/ec-v06/kustomization.yaml overlays/${KONFLUX_APPLICATION_NAME}/kustomization.yaml -EOT1 +Update kustomization.yaml to add the extra row. -# (Breaking up the long heredoc) -cat <