Drone: Make parallel step for publishing front-end metrics (#27457)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen 2020-09-09 10:21:16 +02:00 committed by GitHub
parent c7b8d85ce5
commit efe1287be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 13 deletions

View File

@ -298,6 +298,14 @@ steps:
image: grafana/build-container:1.2.26
commands:
- yarn run ci:test-frontend
environment:
TEST_MAX_WORKERS: 50%
depends_on:
- initialize
- name: frontend-metrics
image: grafana/build-container:1.2.26
commands:
- ./scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY}
environment:
GRAFANA_MISC_STATS_API_KEY:

View File

@ -82,7 +82,8 @@ def master_pipelines(edition):
codespell_step(),
shellcheck_step(),
test_backend_step(),
test_frontend_step(publish_metrics=True),
test_frontend_step(),
frontend_metrics_step(),
build_backend_step(edition=edition),
build_frontend_step(edition=edition),
build_plugins_step(edition=edition),
@ -353,13 +354,8 @@ def test_backend_step():
],
}
def test_frontend_step(publish_metrics=False):
cmds = [
'yarn run ci:test-frontend',
]
if publish_metrics:
cmds.append('./scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY}')
dct = {
def test_frontend_step():
return {
'name': 'test-frontend',
'image': build_image,
'depends_on': [
@ -368,16 +364,28 @@ def test_frontend_step(publish_metrics=False):
'environment': {
'TEST_MAX_WORKERS': '50%',
},
'commands': cmds,
'commands': [
'yarn run ci:test-frontend',
],
}
if publish_metrics:
dct['environment'] = {
def frontend_metrics_step():
return {
'name': 'frontend-metrics',
'image': build_image,
'depends_on': [
'initialize',
],
'environment': {
'GRAFANA_MISC_STATS_API_KEY': {
'from_secret': 'grafana_misc_stats_api_key',
},
},
'commands': [
'./scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY}',
],
}
return dct
def codespell_step():
return {