[v8.4.x] CI: Sync CI changes with v8.4.x (#47007)

* CI: Trigger release build upon drone yaml changes (#46882)

* Add trigger-test-release step

* Change cd command

* Add failure:ignore

* Add depth when cloning

* Fix wrong secret

(cherry picked from commit 758ccfb69e)

* Fetch tags after cloning (#46921)

(cherry picked from commit 9bf82c37e3)

* Add GH token when referring to remote - add --quite when running git push (#46926)

(cherry picked from commit 0e682397ab)

* Sign drone
This commit is contained in:
Dimitris Sotirakis
2022-03-29 11:05:20 +01:00
committed by GitHub
parent 30757ee92d
commit bf0a07f7d2
2 changed files with 60 additions and 1 deletions
+26 -1
View File
@@ -702,6 +702,31 @@ 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 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}
- 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
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:
@@ -4388,6 +4413,6 @@ kind: secret
name: gcp_upload_artifacts_key
---
kind: signature
hmac: 15995eff6e5351403469b2bedcd93aa4e645d43a94f10eda77a9ee4df17eb53b
hmac: 44e231d2b9a32f86b414ad57bd5d144eb6746baf3b01b037e3a1f4cb94df8a76
...
+34
View File
@@ -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,35 @@ 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 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}',
'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',
],
'failure': 'ignore',
'when': {
'paths': {
'include': [
'.drone.yml',
]
}
}
}
def main_pipelines(edition):
services = integration_test_services(edition)
volumes = integration_test_services_volumes()