From 1ce8dc979a40a4498875886c15334aa538bd4d39 Mon Sep 17 00:00:00 2001 From: Christophe Loiseau Date: Thu, 16 May 2024 12:57:19 +0200 Subject: [PATCH] Add promotion doc --- .github/ISSUE_TEMPLATE/release.md | 1 + docs/publication/promote.md | 19 +++++++++++++++++++ docs/publication/promote.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 docs/publication/promote.md create mode 100755 docs/publication/promote.sh diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 7f4e2c39ce9..29db458d513 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -33,6 +33,7 @@ Feel free to edit this release checklist in-progress depending on what tasks nee click `+Create new tag vX.Y.Z.W on release`. - [ ] Re-use the changelog section as release description, and the version as title. - [ ] Check if the pipeline built the release versions in the Actions-Section (or you won't see it). +- [ ] Promote the artifacts in Azure Devops. Check [this procedure](../../docs/publication/promote.md). - [ ] Revisit the changed list of tasks and compare it with [.github/ISSUE_TEMPLATE/release.md](https://github.com/sovity/edc-extensions/blob/default/.github/ISSUE_TEMPLATE/release.md). Propose changes where it makes sense. diff --git a/docs/publication/promote.md b/docs/publication/promote.md new file mode 100644 index 00000000000..2a1b9159ee8 --- /dev/null +++ b/docs/publication/promote.md @@ -0,0 +1,19 @@ +# Promoting an artifact in Azure Devops + +After the artifacts are published, they must be [promoted](https://learn.microsoft.com/en-us/azure/devops/artifacts/feeds/views?view=azure-devops&tabs=nuget) to indicate that they are ready to use. + +This can either be done manually or via the web API. + +The [promote.sh](promote.sh) does this. + +You will need to specify an Azure Personal Access Token that has the permissions: +- Packaging + - Read + - Write + - Manage + +And use the script like this: + +```sh +AZURE_PAT="" VERSION="" ./promote.sh +``` diff --git a/docs/publication/promote.sh b/docs/publication/promote.sh new file mode 100755 index 00000000000..ab00a29538a --- /dev/null +++ b/docs/publication/promote.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +curl -H "Authorization: Basic $AZURE_PAT" \ +"https://feeds.dev.azure.com/sovity/41799556-91c8-4df6-8ddb-4471d6f15953/_apis/packaging/Feeds/core-edc/packages?protocolType=maven&includeUrls=false&includeAllVersions=true&includeDeleted=false&api-version=7.0" > /tmp/artifacts + +for arti in $(cat /tmp/artifacts | jq --raw-output '.value[].name' | cut -d ':' -f 2) +do + curl \ + -X PATCH \ + -H "Authorization: Basic $AZURE_PAT" \ + -H "Content-Type: application/json" \ + "https://pkgs.dev.azure.com/sovity/41799556-91c8-4df6-8ddb-4471d6f15953/_apis/packaging/feeds/core-edc/maven/groups/org.eclipse.edc/artifacts/${arti}/versions/${VERSION}?api-version=7.1-preview.1" \ + --data-binary @- << EOF +{ + "views": { + "op": "add", + "path": "/views/-", + "value": "Release" + } +} + +EOF + + if [[ $? -ne 0 ]] + then + echo "Failed to promote $arti" + exit 1 + fi + +done