diff --git a/.drone.yml b/.drone.yml index bd33753f682..b4414485faf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -366,11 +366,15 @@ steps: --depth=1 - cd grafana-enterprise - git fetch origin "refs/tags/*:refs/tags/*" - - git tag -d $${TEST_TAG} && git push --delete origin $${TEST_TAG} && git tag $${TEST_TAG} - && git push origin $${TEST_TAG} + - if git show-ref --tags $${TEST_TAG} --quiet; then git tag -d $${TEST_TAG} && git + push --delete origin $${TEST_TAG}; fi + - git tag $${TEST_TAG} && git push origin $${TEST_TAG} - cd - - - git tag -d $${TEST_TAG} && git push --delete https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git - --quiet $${TEST_TAG} && git tag $${TEST_TAG} && git push https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git + - git fetch https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git "refs/tags/*:refs/tags/*" + - if git show-ref --tags $${TEST_TAG} --quiet; then git tag -d $${TEST_TAG} && git + push --delete https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git $${TEST_TAG}; + fi + - git tag $${TEST_TAG} && git push https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git $${TEST_TAG} --quiet environment: DOWNSTREAM_REPO: @@ -1226,11 +1230,15 @@ steps: --depth=1 - cd grafana-enterprise - git fetch origin "refs/tags/*:refs/tags/*" - - git tag -d $${TEST_TAG} && git push --delete origin $${TEST_TAG} && git tag $${TEST_TAG} - && git push origin $${TEST_TAG} + - if git show-ref --tags $${TEST_TAG} --quiet; then git tag -d $${TEST_TAG} && git + push --delete origin $${TEST_TAG}; fi + - git tag $${TEST_TAG} && git push origin $${TEST_TAG} - cd - - - git tag -d $${TEST_TAG} && git push --delete https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git - --quiet $${TEST_TAG} && git tag $${TEST_TAG} && git push https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git + - git fetch https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git "refs/tags/*:refs/tags/*" + - if git show-ref --tags $${TEST_TAG} --quiet; then git tag -d $${TEST_TAG} && git + push --delete https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git $${TEST_TAG}; + fi + - git tag $${TEST_TAG} && git push https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git $${TEST_TAG} --quiet environment: DOWNSTREAM_REPO: @@ -5326,6 +5334,6 @@ kind: secret name: packages_secret_access_key --- kind: signature -hmac: 087389ff6763157d4d925bcda07fb9c40c37bee40fa69584b8df1a0e1cbcc57d +hmac: 103a4521f9612a023213940f390e14a974d270df37165bc5c73fd6a28ddef2f6 ... diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 3fccc1fd8de..9a6c3073e1c 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -1206,9 +1206,12 @@ def trigger_test_release(): 'git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" --depth=1', 'cd grafana-enterprise', 'git fetch origin "refs/tags/*:refs/tags/*"', - 'git tag -d $${TEST_TAG} && git push --delete origin $${TEST_TAG} && git tag $${TEST_TAG} && git push origin $${TEST_TAG}', + 'if git show-ref --tags $${TEST_TAG} --quiet; then git tag -d $${TEST_TAG} && git push --delete origin $${TEST_TAG}; fi', + 'git tag $${TEST_TAG} && git push origin $${TEST_TAG}', 'cd -', - 'git tag -d $${TEST_TAG} && git push --delete https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git --quiet $${TEST_TAG} && git tag $${TEST_TAG} && git push https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git $${TEST_TAG} --quiet', + 'git fetch https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git "refs/tags/*:refs/tags/*"', + 'if git show-ref --tags $${TEST_TAG} --quiet; then git tag -d $${TEST_TAG} && git push --delete https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git $${TEST_TAG}; fi', + 'git tag $${TEST_TAG} && git push https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git $${TEST_TAG} --quiet', ], 'failure': 'ignore', 'when': {