CI: Trigger tag on CI changes (#55388)

* Trigger tag on CI changes

* Use github token available for PRs

Remove remote addition

* Replace origin with full url

Remove fetch for origin

Fix fetch

Remove --quite

Add rebase

Stash changes from verify-gen-cue

Cleanup

* Add --quiet when fetching
This commit is contained in:
Dimitris Sotirakis
2022-10-11 12:01:18 +03:00
committed by GitHub
parent ef17f12c23
commit 66cb56de79
4 changed files with 53 additions and 52 deletions

View File

@@ -445,9 +445,6 @@ def release_pipelines(ver_mode='release', trigger=None):
]
},
'ref': ['refs/tags/v*',],
'repo': {
'exclude': ['grafana/grafana'],
},
}
# The release pipelines include also enterprise ones, so both editions are built for a release.

View File

@@ -53,7 +53,7 @@ def build_e2e(trigger, ver_mode, edition):
yarn_install_step(),
]
build_steps = []
if ver_mode == 'main':
if ver_mode == 'main' or ver_mode == 'pr':
build_steps.extend([trigger_test_release()])
if ver_mode == 'pr':
build_steps.extend([enterprise_downstream_step(edition=edition, ver_mode=ver_mode)])

View File

@@ -1202,19 +1202,20 @@ def trigger_test_release():
'name': 'trigger-test-release',
'image': build_image,
'environment': {
'GITHUB_TOKEN': from_secret('github_token'),
'GITHUB_TOKEN': from_secret('github_token_pr'),
'DOWNSTREAM_REPO': from_secret('downstream'),
'TEST_TAG': 'v0.0.0-test',
},
'commands': [
'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}',
'git fetch origin "refs/tags/*:refs/tags/*" --quiet',
'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 fetch origin "refs/tags/*:refs/tags/*"',
'git remote add downstream https://$${GITHUB_TOKEN}@github.com/grafana/$${DOWNSTREAM_REPO}.git',
'git tag -d $${TEST_TAG} && git push --delete downstream --quiet $${TEST_TAG} && git tag $${TEST_TAG} && git push downstream $${TEST_TAG} --quiet',
'git fetch https://$${GITHUB_TOKEN}@github.com/grafana/grafana.git "refs/tags/*:refs/tags/*" --quiet && git fetch --quiet',
'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}',
],
'failure': 'ignore',
'when': {