Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
34a355fe
Unverified
Commit
34a355fe
authored
Sep 30, 2020
by
Arve Knudsen
Committed by
GitHub
Sep 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drone: Add Slack failure notifier (#27920)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent
739395ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
13 deletions
+69
-13
.drone.yml
+22
-0
scripts/lib.star
+47
-13
No files found.
.drone.yml
View file @
34a355fe
...
@@ -276,6 +276,17 @@ steps:
...
@@ -276,6 +276,17 @@ steps:
environment
:
environment
:
DOCKERIZE_VERSION
:
0.6.1
DOCKERIZE_VERSION
:
0.6.1
-
name
:
slack
image
:
plugins/slack
settings
:
channel
:
grafana-ci-failures
template
:
"
Build
{{build.number}}
failed:
{{build.link}}"
webhook
:
from_secret
:
slack_webhook
when
:
status
:
-
failure
-
name
:
trigger-enterprise-downstream
-
name
:
trigger-enterprise-downstream
image
:
grafana/drone-downstream
image
:
grafana/drone-downstream
settings
:
settings
:
...
@@ -642,6 +653,17 @@ steps:
...
@@ -642,6 +653,17 @@ steps:
environment
:
environment
:
DOCKERIZE_VERSION
:
0.6.1
DOCKERIZE_VERSION
:
0.6.1
-
name
:
slack
image
:
plugins/slack
settings
:
channel
:
grafana-ci-failures
template
:
"
Build
{{build.number}}
failed:
{{build.link}}"
webhook
:
from_secret
:
slack_webhook
when
:
status
:
-
failure
-
name
:
publish-packages
-
name
:
publish-packages
image
:
grafana/grafana-ci-deploy:1.2.6
image
:
grafana/grafana-ci-deploy:1.2.6
commands
:
commands
:
...
...
scripts/lib.star
View file @
34a355fe
...
@@ -9,6 +9,7 @@ dockerize_version = '0.6.1'
...
@@ -9,6 +9,7 @@ dockerize_version = '0.6.1'
wix_image = 'grafana/ci-wix:0.1.1'
wix_image = 'grafana/ci-wix:0.1.1'
def pr_pipelines(edition):
def pr_pipelines(edition):
version_mode = 'pr'
services = [
services = [
{
{
'name': 'postgres',
'name': 'postgres',
...
@@ -50,16 +51,18 @@ def pr_pipelines(edition):
...
@@ -50,16 +51,18 @@ def pr_pipelines(edition):
postgres_integration_tests_step(),
postgres_integration_tests_step(),
mysql_integration_tests_step(),
mysql_integration_tests_step(),
]
]
windows_steps = get_windows_steps(edition=edition, version_mode=
'pr'
)
windows_steps = get_windows_steps(edition=edition, version_mode=
version_mode
)
trigger = {
trigger = {
'event': ['pull_request',],
'event': ['pull_request',],
}
}
return [
return [
pipeline(
pipeline(
name='test-pr', edition=edition, trigger=trigger, services=services, steps=steps
name='test-pr', edition=edition, trigger=trigger, services=services, steps=steps,
version_mode=version_mode,
),
),
pipeline(
pipeline(
name='windows-pr', edition=edition, trigger=trigger, steps=windows_steps, platform='windows',
name='windows-pr', edition=edition, trigger=trigger, steps=windows_steps, platform='windows',
version_mode=version_mode,
),
),
]
]
...
@@ -100,6 +103,7 @@ def master_steps(edition, is_downstream=False):
...
@@ -100,6 +103,7 @@ def master_steps(edition, is_downstream=False):
return steps, windows_steps, publish_steps
return steps, windows_steps, publish_steps
def master_pipelines(edition):
def master_pipelines(edition):
version_mode = 'master'
services = [
services = [
{
{
'name': 'postgres',
'name': 'postgres',
...
@@ -128,17 +132,18 @@ def master_pipelines(edition):
...
@@ -128,17 +132,18 @@ def master_pipelines(edition):
steps, windows_steps, publish_steps = master_steps(edition=edition)
steps, windows_steps, publish_steps = master_steps(edition=edition)
pipelines = [
pipelines = [
pipeline(
pipeline(
name='build-master', edition=edition, trigger=trigger, services=services, steps=steps
name='build-master', edition=edition, trigger=trigger, services=services, steps=steps,
version_mode=version_mode,
),
),
pipeline(
pipeline(
name='windows-master', edition=edition, trigger=trigger, steps=windows_steps, platform='windows',
name='windows-master', edition=edition, trigger=trigger, steps=windows_steps, platform='windows',
depends_on=['build-master'],
depends_on=['build-master'],
version_mode=version_mode,
),
),
]
]
if edition != 'enterprise':
if edition != 'enterprise':
pipelines.append(pipeline(
pipelines.append(pipeline(
name='publish-master', edition=edition, trigger=trigger, steps=publish_steps,
name='publish-master', edition=edition, trigger=trigger, steps=publish_steps,
depends_on=['build-master', 'windows-master',], install_deps=False,
depends_on=['build-master', 'windows-master',], install_deps=False,
version_mode=version_mode,
))
))
if edition == 'enterprise':
if edition == 'enterprise':
# Add downstream enterprise pipelines triggerable from OSS builds
# Add downstream enterprise pipelines triggerable from OSS builds
...
@@ -148,21 +153,24 @@ def master_pipelines(edition):
...
@@ -148,21 +153,24 @@ def master_pipelines(edition):
steps, windows_steps, publish_steps = master_steps(edition=edition, is_downstream=True)
steps, windows_steps, publish_steps = master_steps(edition=edition, is_downstream=True)
pipelines.append(pipeline(
pipelines.append(pipeline(
name='build-master-downstream', edition=edition, trigger=trigger, services=services, steps=steps,
name='build-master-downstream', edition=edition, trigger=trigger, services=services, steps=steps,
is_downstream=True,
is_downstream=True,
version_mode=version_mode,
))
))
pipelines.append(pipeline(
pipelines.append(pipeline(
name='windows-master-downstream', edition=edition, trigger=trigger, steps=windows_steps,
name='windows-master-downstream', edition=edition, trigger=trigger, steps=windows_steps,
platform='windows', depends_on=['build-master-downstream'], is_downstream=True,
platform='windows', depends_on=['build-master-downstream'], is_downstream=True,
version_mode=version_mode,
))
))
pipelines.append(pipeline(
pipelines.append(pipeline(
name='publish-master-downstream', edition=edition, trigger=trigger, steps=publish_steps,
name='publish-master-downstream', edition=edition, trigger=trigger, steps=publish_steps,
depends_on=['build-master-downstream', 'windows-master-downstream'], is_downstream=True, install_deps=False,
depends_on=['build-master-downstream', 'windows-master-downstream'], is_downstream=True, install_deps=False,
version_mode=version_mode,
))
))
return pipelines
return pipelines
def pipeline(name, edition, trigger, steps, services=[], platform='linux', depends_on=[], is_downstream=False,
def pipeline(
install_deps=True):
name, edition, trigger, steps, version_mode, services=[], platform='linux', depends_on=[],
is_downstream=False, install_deps=True,
):
if platform != 'windows':
if platform != 'windows':
platform_conf = {
platform_conf = {
'os': 'linux',
'os': 'linux',
...
@@ -182,7 +190,9 @@ def pipeline(name, edition, trigger, steps, services=[], platform='linux', depen
...
@@ -182,7 +190,9 @@ def pipeline(name, edition, trigger, steps, services=[], platform='linux', depen
'name': name,
'name': name,
'trigger': trigger,
'trigger': trigger,
'services': services,
'services': services,
'steps': init_steps(edition, platform, is_downstream=is_downstream, install_deps=install_deps) + steps,
'steps': init_steps(
edition, platform, is_downstream=is_downstream, install_deps=install_deps, version_mode=version_mode,
) + steps,
'depends_on': depends_on,
'depends_on': depends_on,
}
}
...
@@ -194,7 +204,23 @@ def pipeline(name, edition, trigger, steps, services=[], platform='linux', depen
...
@@ -194,7 +204,23 @@ def pipeline(name, edition, trigger, steps, services=[], platform='linux', depen
return pipeline
return pipeline
def init_steps(edition, platform, is_downstream=False, install_deps=True):
def slack_step(channel):
return {
'name': 'slack',
'image': 'plugins/slack',
'settings': {
'webhook': {
'from_secret': 'slack_webhook',
},
'channel': channel,
'template': 'Build {{build.number}} failed: {{build.link}}',
},
'when': {
'status': ['failure',],
},
}
def init_steps(edition, platform, version_mode, is_downstream=False, install_deps=True):
if platform == 'windows':
if platform == 'windows':
return [
return [
{
{
...
@@ -228,7 +254,7 @@ def init_steps(edition, platform, is_downstream=False, install_deps=True):
...
@@ -228,7 +254,7 @@ def init_steps(edition, platform, is_downstream=False, install_deps=True):
source_commit = ' $${SOURCE_COMMIT}'
source_commit = ' $${SOURCE_COMMIT}'
else:
else:
source_commit = ''
source_commit = ''
return
[
steps =
[
identify_runner_step,
identify_runner_step,
{
{
'name': 'clone',
'name': 'clone',
...
@@ -266,8 +292,11 @@ def init_steps(edition, platform, is_downstream=False, install_deps=True):
...
@@ -266,8 +292,11 @@ def init_steps(edition, platform, is_downstream=False, install_deps=True):
] + common_cmds,
] + common_cmds,
},
},
]
]
if version_mode == 'master':
steps.append(slack_step(channel='grafana-enterprise-ci-failures'))
return steps
return
[
steps =
[
identify_runner_step,
identify_runner_step,
{
{
'name': 'initialize',
'name': 'initialize',
...
@@ -286,6 +315,11 @@ def init_steps(edition, platform, is_downstream=False, install_deps=True):
...
@@ -286,6 +315,11 @@ def init_steps(edition, platform, is_downstream=False, install_deps=True):
},
},
]
]
if version_mode == 'master':
steps.append(slack_step(channel='grafana-ci-failures'))
return steps
def enterprise_downstream_step(edition):
def enterprise_downstream_step(edition):
if edition == 'enterprise':
if edition == 'enterprise':
return None
return None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment