Skip to content

Commit

Permalink
refined search of branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdorsch committed Jul 22, 2022
1 parent f3c982a commit 9d4660d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,22 @@ 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"
fi
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
Expand Down

0 comments on commit 9d4660d

Please sign in to comment.