diff --git a/.drone.yml b/.drone.yml index 09e7ec86cc7..0980c901ae2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4165,6 +4165,49 @@ volumes: path: /var/run/docker.sock name: docker --- +clone: + retries: 3 +depends_on: [] +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: publish-grafanacom +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.23.1-alpine + name: compile-build-cmd +- commands: + - ./bin/build publish grafana-com --edition oss ${DRONE_TAG} + depends_on: + - compile-build-cmd + environment: + GCP_KEY: + from_secret: gcp_grafanauploads_base64 + GRAFANA_COM_API_KEY: + from_secret: grafana_api_key + image: grafana/grafana-ci-deploy:1.3.3 + name: publish-grafanacom +trigger: + event: + - promote + target: publish-grafanacom +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +--- clone: retries: 3 depends_on: @@ -6108,6 +6151,6 @@ kind: secret name: gcr_credentials --- kind: signature -hmac: 7335b2e56769f72716f5dac524741e423abb99eacf775fa635e59c2d658c8aee +hmac: 4a043d63a119ebf5920b600fce404d98f570504e855039cc4787c2fa1ab04669 ... diff --git a/scripts/drone/events/release.star b/scripts/drone/events/release.star index 94af7b2335c..9f7a5563e4a 100644 --- a/scripts/drone/events/release.star +++ b/scripts/drone/events/release.star @@ -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(): diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index ccdc41ac03e..97f4bb40a70 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -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),