From b009c342b5ccfacefba7f6b68a0e5ac8f71f8fa0 Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Molins Date: Fri, 9 Aug 2024 17:23:41 +0200 Subject: [PATCH] [CI] Update label in schedule daily job definition as part of the automation (#10722) Update label step in the schedule daily job using updatecli so it gets updated with the latest snapshot version (major and minor) accordingly with the STACK_VERSION value. --- .../bump-latest-snapshot-version.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/updatecli/updatecli.d/bump-latest-snapshot-version.yml b/.github/workflows/updatecli/updatecli.d/bump-latest-snapshot-version.yml index d4ca8b55c39..0943b8dab10 100644 --- a/.github/workflows/updatecli/updatecli.d/bump-latest-snapshot-version.yml +++ b/.github/workflows/updatecli/updatecli.d/bump-latest-snapshot-version.yml @@ -31,6 +31,16 @@ sources: spec: file: https://storage.googleapis.com/artifacts-api/snapshots/main.json key: .version + latestSnapshotMajorMinor: + name: Get latest snapshort major and minor + kind: json + spec: + file: https://storage.googleapis.com/artifacts-api/snapshots/main.json + key: .version + transformers: + - findsubmatch: + pattern: '(^\d+\.\d+)\.[^\s]+$' + captureindex: 1 targets: update-snapshot: @@ -42,3 +52,13 @@ targets: file: '.buildkite/pipeline.schedule-daily.yml' matchpattern: '(STACK_VERSION:) 8\.[^\s]*\.[^\s]*' replacepattern: '$1 {{ source "latestSnapshot" }}' + + update-snapshot-label: + name: '[updatecli] Update latest snapshot label step to {{ source "latestSnapshotMajorMinor" }}' + kind: file + sourceid: latestSnapshotMajorMinor + scmid: default + spec: + file: '.buildkite/pipeline.schedule-daily.yml' + matchpattern: '(Stack Version) v8\.\d+"' + replacepattern: 'Stack Version v{{ source "latestSnapshotMajorMinor" }}"'