From 782862639610c835afe0fbc94acd233e13ad591b Mon Sep 17 00:00:00 2001
From: Massimiliano Adamo <massimiliano.adamo@geant.org>
Date: Thu, 3 Jun 2021 18:49:27 +0200
Subject: [PATCH] upload custom properties to artifactory

---
 .gitlab-ci-psnc.yml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.gitlab-ci-psnc.yml b/.gitlab-ci-psnc.yml
index 7e9e80c..2c22931 100644
--- a/.gitlab-ci-psnc.yml
+++ b/.gitlab-ci-psnc.yml
@@ -7,7 +7,9 @@ stages:
 
 variables:
   ARTIFACTORY_BASE_URL: https://artifactory.software.geant.org/artifactory/acme-downloader
+  ARTIFACTORY_METADATA_URL: https://artifactory.software.geant.org/artifactory/api/storage/acme-downloader
   ARTIFACT_NAME: acme-downloader
+  ARTIFACT_VERSION: ${CI_COMMIT_TAG:1}
 
 sonarqube:
   image: sonarsource/sonar-scanner-cli:${SONAR_SCANNER_CLI_VERSION}
@@ -37,6 +39,7 @@ upload_linux_amd64_binary:
   script:
     - ./build.sh --os=linux --arch=amd64 --version=$CI_COMMIT_TAG --upx
     - 'curl -sSf -H "X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}" -X PUT -T ./$ARTIFACT_NAME ${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}_linux_amd64'
+    - 'curl -sSf -H "X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}" -X PUT "${ARTIFACTORY_METADATA_URL}/${ARTIFACT_NAME}_linux_amd64?properties=version=${ARTIFACT_VERSION}"'
   tags:
     - acme
 
@@ -47,5 +50,6 @@ upload_windows_amd64_binary:
   script:
     - ./build.sh --os=windows --arch=amd64 --version=$CI_COMMIT_TAG --upx
     - 'curl -sSf -H "X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}" -X PUT -T ./${ARTIFACT_NAME}.exe ${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}_windows_amd64.exe'
+    - 'curl -sSf -H "X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}" -X PUT "${ARTIFACTORY_METADATA_URL}/${ARTIFACT_NAME}_windows_amd64.exe?properties=version=${ARTIFACT_VERSION}"'
   tags:
     - acme
-- 
GitLab