CI: add promotion step for publish grafanacom (#93851)

* add promotion step for publish grafanacom

* publish-grafanacom depends on compile-build-cmd

* use DRONE_TAG

* add docstring comment for depends_on
This commit is contained in:
Kevin Minehart
2024-09-26 16:19:19 -05:00
committed by GitHub
parent 6951feff88
commit a847608061
3 changed files with 59 additions and 6 deletions

View File

@@ -242,6 +242,17 @@ def publish_packages_pipeline():
depends_on = deps,
environment = {"EDITION": "oss"},
),
pipeline(
name = "publish-grafanacom",
trigger = {
"event": ["promote"],
"target": "publish-grafanacom",
},
steps = [
compile_build_cmd(),
publish_grafanacom_step(ver_mode = "release", depends_on = ["compile-build-cmd"]),
],
),
]
def publish_npm_pipelines():

View File

@@ -727,6 +727,7 @@ def frontend_metrics_step(trigger = None):
Returns:
Drone step.
"""
step = {
"name": "publish-frontend-metrics",
"image": images["node"],
@@ -1178,7 +1179,7 @@ def upload_packages_step(ver_mode, trigger = None):
step = dict(step, when = trigger)
return step
def publish_grafanacom_step(ver_mode):
def publish_grafanacom_step(ver_mode, depends_on = ["publish-linux-packages-deb", "publish-linux-packages-rpm"]):
"""Publishes Grafana packages to grafana.com.
Args:
@@ -1186,6 +1187,7 @@ def publish_grafanacom_step(ver_mode):
variable as the value for the --build-id option.
TODO: is this actually used by the grafanacom subcommand? I think it might
just use the environment variable directly.
depends_on: what other steps this one depends on (strings)
Returns:
Drone step.
@@ -1203,10 +1205,7 @@ def publish_grafanacom_step(ver_mode):
return {
"name": "publish-grafanacom",
"image": images["publish"],
"depends_on": [
"publish-linux-packages-deb",
"publish-linux-packages-rpm",
],
"depends_on": depends_on,
"environment": {
"GRAFANA_COM_API_KEY": from_secret("grafana_api_key"),
"GCP_KEY": from_secret(gcp_grafanauploads_base64),