diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 515836d1..a0fe1a24 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -198,16 +198,14 @@ tag_release: - export VAULT_ADDR="https://vault.svc.cscs.ch" - export VAULT_TOKEN=$CI_VAULT_TOKEN - GITLAB_ACCESS_TOKEN="$(vault kv get -field=GITLAB_ACCESS_TOKEN firecrest/dev)" - - - echo "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_COMMIT_SHORT_SHA}/refs?type=branch" - + - | - curl -sS --header "PRIVATE-TOKEN: ${GITLAB_ACCESS_TOKEN}" "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_COMMIT_SHORT_SHA}/refs?type=branch" | jq '.[].name' | grep master + curl -sS --header "PRIVATE-TOKEN: ${GITLAB_ACCESS_TOKEN}" "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_COMMIT_SHORT_SHA}/refs?type=branch" | jq '.[].name=="master"' - branch=$(curl -sS --header "PRIVATE-TOKEN: ${GITLAB_ACCESS_TOKEN}" "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_COMMIT_SHORT_SHA}/refs?type=branch" | jq '.[].name' | grep master) + branch=$(curl -sS --header "PRIVATE-TOKEN: ${GITLAB_ACCESS_TOKEN}" "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_COMMIT_SHORT_SHA}/refs?type=branch" | jq '.[].name=="master"') env_tags="tds" - if [ "$branch" != "" ]; then + if [ "$branch" == "true" ]; then if [ "${CI_COMMIT_TAG:0:4}" == "prod" ]; then env_tags="$CI_COMMIT_TAG prod" @@ -215,6 +213,7 @@ tag_release: for tag in $env_tags; do images="compute reservations status storage tasks utilities"; for img in $images; do + echo "jfrog rt copy --flat=true --url=https://$CI_REGISTRY/artifactory --user=$CI_REGISTRY_USER --password=XXX $CI_REGISTRY_GROUP/$image/$CI_COMMIT_SHORT_SHA/ $CI_REGISTRY_GROUP/$img/$tag/" jfrog rt copy --flat=true --url="https://$CI_REGISTRY/artifactory" --user="$CI_REGISTRY_USER" --password="$CI_REGISTRY_PASSWORD" "$CI_REGISTRY_GROUP/$image/$CI_COMMIT_SHORT_SHA/" "$CI_REGISTRY_GROUP/$img/$tag/"; done done