diff --git a/.drone.yml b/.drone.yml index 2719eedf90e..7db6d24b94d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -702,6 +702,29 @@ steps: - yarn install --immutable image: grafana/build-container:1.5.3 name: initialize +- commands: + - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" + --depth=1 + - cd grafana-enterprise + - git tag -d $${TEST_TAG} && git push --delete origin $${TEST_TAG} && git tag $${TEST_TAG} + && git push origin $${TEST_TAG} + - cd - + - git remote add downstream https://github.com/grafana/$${DOWNSTREAM_REPO}.git + - git tag -d $${TEST_TAG} && git push --delete downstream $${TEST_TAG} && git tag + $${TEST_TAG} && git push downstream $${TEST_TAG} + environment: + DOWNSTREAM_REPO: + from_secret: downstream + GITHUB_TOKEN: + from_secret: github_token + TEST_TAG: v0.0.0-test + failure: ignore + image: grafana/build-container:1.5.3 + name: trigger-test-release + when: + paths: + include: + - .drone.yml - image: grafana/drone-downstream name: trigger-enterprise-downstream settings: @@ -4386,6 +4409,6 @@ kind: secret name: gcp_upload_artifacts_key --- kind: signature -hmac: a14708e4946492b73da169e1d7719ced3508da27df8d1ecd1e3caf0985daad58 +hmac: f8ee7ebfe0dd8221b71c0f0d01fa7dfd41be01526959c35b6f2eb4069babbf51 ... diff --git a/scripts/drone/pipelines/main.star b/scripts/drone/pipelines/main.star index 380069d71ce..1c9b9a84c26 100644 --- a/scripts/drone/pipelines/main.star +++ b/scripts/drone/pipelines/main.star @@ -1,6 +1,7 @@ load( 'scripts/drone/steps/lib.star', 'download_grabpl_step', + 'build_image', 'initialize_step', 'lint_drone_step', 'lint_backend_step', @@ -60,6 +61,9 @@ load( 'docs_pipelines', ) +load('scripts/drone/vault.star', 'from_secret') + + ver_mode = 'main' def get_steps(edition, is_downstream=False): @@ -77,6 +81,7 @@ def get_steps(edition, is_downstream=False): test_frontend_step(), ] build_steps = [ + trigger_test_release(), enterprise_downstream_step(edition=edition), build_backend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream), build_frontend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream), @@ -150,6 +155,33 @@ def get_steps(edition, is_downstream=False): return test_steps, build_steps, integration_test_steps, windows_steps, store_steps +def trigger_test_release(): + return { + 'name': 'trigger-test-release', + 'image': build_image, + 'environment': { + 'GITHUB_TOKEN': from_secret('github_token'), + '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 tag -d $${TEST_TAG} && git push --delete origin $${TEST_TAG} && git tag $${TEST_TAG} && git push origin $${TEST_TAG}', + 'cd -', + 'git remote add downstream https://github.com/grafana/$${DOWNSTREAM_REPO}.git', + 'git tag -d $${TEST_TAG} && git push --delete downstream $${TEST_TAG} && git tag $${TEST_TAG} && git push downstream $${TEST_TAG}', + ], + 'failure': 'ignore', + 'when': { + 'paths': { + 'include': [ + '.drone.yml', + ] + } + } + } + def main_pipelines(edition): services = integration_test_services(edition) volumes = integration_test_services_volumes()