CI: Notify channel on drone yaml changes (#42428)
* Notify on drone yaml changes * Change secrets * Remove test notification * Fix typo
This commit is contained in:
@@ -49,6 +49,8 @@ load(
|
||||
'scripts/drone/utils/utils.star',
|
||||
'pipeline',
|
||||
'notify_pipeline',
|
||||
'failure_template',
|
||||
'drone_change_template',
|
||||
)
|
||||
|
||||
ver_mode = 'main'
|
||||
@@ -142,6 +144,18 @@ def main_pipelines(edition):
|
||||
'event': ['push',],
|
||||
'branch': 'main',
|
||||
}
|
||||
drone_change_trigger = {
|
||||
'event': ['push',],
|
||||
'branch': 'main',
|
||||
'paths': {
|
||||
'include': [
|
||||
'.drone.yml',
|
||||
],
|
||||
'exclude': [
|
||||
'exclude',
|
||||
],
|
||||
},
|
||||
}
|
||||
steps, windows_steps, publish_steps = get_steps(edition=edition)
|
||||
|
||||
if edition == 'enterprise':
|
||||
@@ -157,6 +171,8 @@ def main_pipelines(edition):
|
||||
name='windows-main', edition=edition, trigger=trigger,
|
||||
steps=initialize_step(edition, platform='windows', ver_mode=ver_mode) + windows_steps,
|
||||
depends_on=['build-main'], platform='windows',
|
||||
), notify_pipeline(
|
||||
name='notify-drone-changes', slack_channel='slack-webhooks-test', trigger=drone_change_trigger, template=drone_change_template, secret='drone-changes-webhook',
|
||||
),
|
||||
]
|
||||
if edition != 'enterprise':
|
||||
@@ -167,8 +183,8 @@ def main_pipelines(edition):
|
||||
))
|
||||
|
||||
pipelines.append(notify_pipeline(
|
||||
name='notify-main', slack_channel='grafana-ci-notifications', trigger=trigger,
|
||||
depends_on=['build-main', 'windows-main', 'publish-main'],
|
||||
name='notify-main', slack_channel='grafana-ci-notifications', trigger=dict(trigger, status = ['failure']),
|
||||
depends_on=['build-main', 'windows-main', 'publish-main'], template=failure_template, secret='slack_webhook'
|
||||
))
|
||||
else:
|
||||
# Add downstream enterprise pipelines triggerable from OSS builds
|
||||
@@ -192,8 +208,8 @@ def main_pipelines(edition):
|
||||
))
|
||||
|
||||
pipelines.append(notify_pipeline(
|
||||
name='notify-main-downstream', slack_channel='grafana-enterprise-ci-notifications', trigger=trigger,
|
||||
depends_on=['build-main-downstream', 'windows-main-downstream', 'publish-main-downstream'],
|
||||
name='notify-main-downstream', slack_channel='grafana-enterprise-ci-notifications', trigger=dict(trigger, status = ['failure']),
|
||||
depends_on=['build-main-downstream', 'windows-main-downstream', 'publish-main-downstream'], template=failure_template, secret='slack_webhook',
|
||||
))
|
||||
|
||||
return pipelines
|
||||
|
||||
@@ -40,7 +40,10 @@ load(
|
||||
|
||||
load(
|
||||
'scripts/drone/utils/utils.star',
|
||||
'notify_pipeline',
|
||||
'pipeline',
|
||||
'failure_template',
|
||||
'drone_change_template',
|
||||
)
|
||||
|
||||
ver_mode = 'pr'
|
||||
@@ -109,7 +112,6 @@ def pr_pipelines(edition):
|
||||
build_steps.extend([
|
||||
package_step(edition=edition2, ver_mode=ver_mode, include_enterprise2=include_enterprise2, variants=['linux-x64']),
|
||||
e2e_tests_server_step(edition=edition2, port=3002),
|
||||
e2e_tests_step(edition=edition2, port=3002),
|
||||
e2e_tests_step('dashboards-suite', edition=edition2, port=3002),
|
||||
e2e_tests_step('smoke-tests-suite', edition=edition2, port=3002),
|
||||
e2e_tests_step('panels-suite', edition=edition2, port=3002),
|
||||
|
||||
@@ -48,6 +48,8 @@ load(
|
||||
'scripts/drone/utils/utils.star',
|
||||
'pipeline',
|
||||
'notify_pipeline',
|
||||
'failure_template',
|
||||
'drone_change_template',
|
||||
)
|
||||
|
||||
def release_npm_packages_step(edition, ver_mode):
|
||||
@@ -227,8 +229,8 @@ def release_pipelines(ver_mode='release', trigger=None):
|
||||
pipelines.append(publish_pipeline)
|
||||
|
||||
pipelines.append(notify_pipeline(
|
||||
name='notify-{}'.format(ver_mode), slack_channel='grafana-ci-notifications', trigger=trigger,
|
||||
depends_on=[p['name'] for p in pipelines],
|
||||
name='notify-{}'.format(ver_mode), slack_channel='grafana-ci-notifications', trigger=dict(trigger, status = ['failure']),
|
||||
depends_on=[p['name'] for p in pipelines], template=failure_template, secret='slack_webhook',
|
||||
))
|
||||
|
||||
return pipelines
|
||||
@@ -260,8 +262,8 @@ def test_release_pipelines():
|
||||
pipelines = oss_pipelines + enterprise_pipelines + [publish_pipeline,]
|
||||
|
||||
pipelines.append(notify_pipeline(
|
||||
name='notify-{}'.format(ver_mode), slack_channel='grafana-ci-notifications', trigger=trigger,
|
||||
depends_on=[p['name'] for p in pipelines],
|
||||
name='notify-{}'.format(ver_mode), slack_channel='grafana-ci-notifications', trigger=dict(trigger, status = ['failure']),
|
||||
depends_on=[p['name'] for p in pipelines], template=failure_template, secret='slack_webhook',
|
||||
))
|
||||
|
||||
return pipelines
|
||||
|
||||
Reference in New Issue
Block a user