Skip to content

Commit

Permalink
Add promotion doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ununhexium committed May 16, 2024
1 parent 1145acd commit 1ce8dc9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 19 additions & 0 deletions docs/publication/promote.md
Original file line number Diff line number Diff line change
@@ -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="<some pat>" VERSION="<version to promote>" ./promote.sh
```
30 changes: 30 additions & 0 deletions docs/publication/promote.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1ce8dc9

Please sign in to comment.