From 65b7c2a54dce5bd0fc405984abb2625046bb4f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Tue, 2 Apr 2024 13:40:34 +0200 Subject: [PATCH 1/2] chore: add `azcopy` updatecli manifest --- updatecli/updatecli.d/azcopy.yml | 72 ++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 updatecli/updatecli.d/azcopy.yml diff --git a/updatecli/updatecli.d/azcopy.yml b/updatecli/updatecli.d/azcopy.yml new file mode 100644 index 0000000..1b35f85 --- /dev/null +++ b/updatecli/updatecli.d/azcopy.yml @@ -0,0 +1,72 @@ +--- +name: Bump `azcopy` version + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastReleaseVersion: + kind: shell + name: Get the latest `azcopy` (full) version + spec: + command: bash -c 'basename "$(dirname "$(curl https://aka.ms/downloadazcopy-v10-linux --write-out "%{redirect_url}" --output /dev/null --silent --fail --show-error)" )"' + transformers: + - trimprefix: 'release-' + +conditions: + testDockerfileArgAzCliVersion: + name: "Does the Dockerfile have an ARG instruction which key is AZCOPY_VERSION?" + kind: dockerfile + disablesourceinput: true + spec: + file: Dockerfile + instruction: + keyword: "ARG" + matcher: "AZCOPY_VERSION" + testCstAzCliVersion: + name: "Does the test harness checks for a label io.jenkins-infra.tools.azcopy.version?" + kind: yaml + disablesourceinput: true + spec: + file: "cst.yml" + key: "metadataTest.labels[6].key" + value: io.jenkins-infra.tools.azcopy.version + +targets: + updateCstVersion: + name: "Update the label io.jenkins-infra.tools.azcopy.version in the test harness" + sourceid: lastReleaseVersion + kind: yaml + spec: + file: "cst.yml" + key: "metadataTest.labels[6].value" + scmid: default + updateDockerfileArgVersion: + name: "Update the value of ARG AZCOPY_VERSION in the Dockerfile" + sourceid: lastReleaseVersion + kind: dockerfile + spec: + file: Dockerfile + instruction: + keyword: "ARG" + matcher: "AZCOPY_VERSION" + scmid: default + +actions: + default: + kind: github/pullrequest + title: Bump azcopy version to {{ source "lastReleaseVersion" }} + scmid: default + spec: + labels: + - enhancement + - azcopy From b8bd6af9ce5e856a73c2ab3eeff5f6d1c6f796da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= <91831478+lemeurherve@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:03:51 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Damien Duportal --- updatecli/updatecli.d/azcopy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updatecli/updatecli.d/azcopy.yml b/updatecli/updatecli.d/azcopy.yml index 1b35f85..5871509 100644 --- a/updatecli/updatecli.d/azcopy.yml +++ b/updatecli/updatecli.d/azcopy.yml @@ -38,7 +38,7 @@ conditions: disablesourceinput: true spec: file: "cst.yml" - key: "metadataTest.labels[6].key" + key: "$.metadataTest.labels[6].key" value: io.jenkins-infra.tools.azcopy.version targets: @@ -48,7 +48,7 @@ targets: kind: yaml spec: file: "cst.yml" - key: "metadataTest.labels[6].value" + key: "$.metadataTest.labels[6].value" scmid: default updateDockerfileArgVersion: name: "Update the value of ARG AZCOPY_VERSION in the Dockerfile"