Skip to content

Commit

Permalink
chore: add azcopy updatecli manifest (#205)
Browse files Browse the repository at this point in the history
* chore: add `azcopy` updatecli manifest

* Apply suggestions from code review

Co-authored-by: Damien Duportal <damien.duportal@gmail.com>

---------

Co-authored-by: Damien Duportal <damien.duportal@gmail.com>
  • Loading branch information
lemeurherve and dduportal committed Apr 2, 2024
1 parent 25d70fd commit 8b9be51
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions updatecli/updatecli.d/azcopy.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8b9be51

Please sign in to comment.