CI: Remove `grafana/drone-grafana-docker` image (#44983)

* Remove grafana/drone-grafana-docker image

* Rename step

* Remove manual gcloud authentication

(cherry picked from commit 329b1a1ef3903c7e2c3ec1f286f9b0f00fcd023e)

* Add publish command for main

* Fix TAG variable parsing

* Remove shouldSave from main builds

* Reorder dependencies

* Update grabpl version
pull/45018/head
Dimitris Sotirakis 3 years ago committed by GitHub
parent a552e7323f
commit 5543ad883d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 216
      .drone.yml
  2. 7
      scripts/drone/pipelines/main.star
  3. 34
      scripts/drone/pipelines/release.star
  4. 57
      scripts/drone/steps/lib.star

@ -11,7 +11,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -111,7 +111,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -309,15 +309,18 @@ steps:
- package - package
image: grafana/build-container:1.4.9 image: grafana/build-container:1.4.9
name: copy-packages-for-docker name: copy-packages-for-docker
- depends_on: - commands:
- ./bin/grabpl build-docker --edition oss -archs amd64
depends_on:
- copy-packages-for-docker - copy-packages-for-docker
image: grafana/drone-grafana-docker:0.3.2 environment:
GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: build-docker-images name: build-docker-images
settings: volumes:
archs: amd64 - name: docker
dry_run: true path: /var/run/docker.sock
edition: oss
ubuntu: false
trigger: trigger:
event: event:
- pull_request - pull_request
@ -359,7 +362,7 @@ services:
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -420,7 +423,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -521,7 +524,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -761,30 +764,66 @@ steps:
- package - package
image: grafana/build-container:1.4.9 image: grafana/build-container:1.4.9
name: copy-packages-for-docker name: copy-packages-for-docker
- depends_on: - commands:
- ./bin/grabpl build-docker --edition oss
depends_on:
- copy-packages-for-docker - copy-packages-for-docker
image: grafana/drone-grafana-docker:0.3.2 environment:
GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: build-docker-images name: build-docker-images
settings: volumes:
dry_run: false - name: docker
edition: oss path: /var/run/docker.sock
password: - commands:
from_secret: docker_password - ./bin/grabpl build-docker --edition oss --ubuntu
ubuntu: false depends_on:
username:
from_secret: docker_user
- depends_on:
- copy-packages-for-docker - copy-packages-for-docker
image: grafana/drone-grafana-docker:0.3.2 environment:
GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: build-docker-images-ubuntu name: build-docker-images-ubuntu
settings: volumes:
dry_run: false - name: docker
edition: oss path: /var/run/docker.sock
password: - commands:
- ./bin/grabpl artifacts docker publish --dockerhub-repo grafana --base alpine --base
ubuntu --arch amd64 --arch arm64 --arch armv7
depends_on:
- build-docker-images
- build-docker-images-ubuntu
environment:
DOCKER_PASSWORD:
from_secret: docker_password from_secret: docker_password
ubuntu: true DOCKER_USER:
username: from_secret: docker_username
from_secret: docker_user GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: publish-images-grafana
volumes:
- name: docker
path: /var/run/docker.sock
- commands:
- ./bin/grabpl artifacts docker publish --dockerhub-repo grafana-oss --base alpine
--base ubuntu --arch amd64 --arch arm64 --arch armv7
depends_on:
- build-docker-images
- build-docker-images-ubuntu
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: publish-images-grafana-oss
volumes:
- name: docker
path: /var/run/docker.sock
- commands: - commands:
- ./scripts/circle-release-canary-packages.sh - ./scripts/circle-release-canary-packages.sh
depends_on: depends_on:
@ -870,7 +909,7 @@ services:
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -938,7 +977,7 @@ steps:
name: identify-runner name: identify-runner
- commands: - commands:
- $$ProgressPreference = "SilentlyContinue" - $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/windows/grabpl.exe - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/windows/grabpl.exe
-OutFile grabpl.exe -OutFile grabpl.exe
image: grafana/ci-wix:0.1.1 image: grafana/ci-wix:0.1.1
name: initialize name: initialize
@ -1021,7 +1060,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -1104,7 +1143,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -1202,8 +1241,6 @@ steps:
image: grafana/build-container:1.4.9 image: grafana/build-container:1.4.9
name: copy-packages-for-docker name: copy-packages-for-docker
- commands: - commands:
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
- ./bin/grabpl build-docker --edition oss --shouldSave - ./bin/grabpl build-docker --edition oss --shouldSave
depends_on: depends_on:
- copy-packages-for-docker - copy-packages-for-docker
@ -1211,13 +1248,11 @@ steps:
GCP_KEY: GCP_KEY:
from_secret: gcp_key from_secret: gcp_key
image: google/cloud-sdk image: google/cloud-sdk
name: package-docker-images name: build-docker-images
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
- ./bin/grabpl build-docker --edition oss --shouldSave --ubuntu - ./bin/grabpl build-docker --edition oss --shouldSave --ubuntu
depends_on: depends_on:
- copy-packages-for-docker - copy-packages-for-docker
@ -1225,7 +1260,7 @@ steps:
GCP_KEY: GCP_KEY:
from_secret: gcp_key from_secret: gcp_key
image: google/cloud-sdk image: google/cloud-sdk
name: package-docker-images-ubuntu name: build-docker-images-ubuntu
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
@ -1412,7 +1447,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -1533,7 +1568,7 @@ services:
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -1617,7 +1652,7 @@ steps:
name: identify-runner name: identify-runner
- commands: - commands:
- $$ProgressPreference = "SilentlyContinue" - $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/windows/grabpl.exe - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/windows/grabpl.exe
-OutFile grabpl.exe -OutFile grabpl.exe
image: grafana/ci-wix:0.1.1 image: grafana/ci-wix:0.1.1
name: initialize name: initialize
@ -1676,7 +1711,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -1808,8 +1843,6 @@ steps:
image: grafana/build-container:1.4.9 image: grafana/build-container:1.4.9
name: copy-packages-for-docker name: copy-packages-for-docker
- commands: - commands:
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
- ./bin/grabpl build-docker --edition enterprise --shouldSave - ./bin/grabpl build-docker --edition enterprise --shouldSave
depends_on: depends_on:
- copy-packages-for-docker - copy-packages-for-docker
@ -1817,13 +1850,11 @@ steps:
GCP_KEY: GCP_KEY:
from_secret: gcp_key from_secret: gcp_key
image: google/cloud-sdk image: google/cloud-sdk
name: package-docker-images name: build-docker-images
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
- ./bin/grabpl build-docker --edition enterprise --shouldSave --ubuntu - ./bin/grabpl build-docker --edition enterprise --shouldSave --ubuntu
depends_on: depends_on:
- copy-packages-for-docker - copy-packages-for-docker
@ -1831,7 +1862,7 @@ steps:
GCP_KEY: GCP_KEY:
from_secret: gcp_key from_secret: gcp_key
image: google/cloud-sdk image: google/cloud-sdk
name: package-docker-images-ubuntu name: build-docker-images-ubuntu
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
@ -2020,7 +2051,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2193,7 +2224,7 @@ services:
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2321,7 +2352,7 @@ steps:
name: identify-runner name: identify-runner
- commands: - commands:
- $$ProgressPreference = "SilentlyContinue" - $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/windows/grabpl.exe - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/windows/grabpl.exe
-OutFile grabpl.exe -OutFile grabpl.exe
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise - cd grafana-enterprise
@ -2396,7 +2427,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2418,8 +2449,8 @@ steps:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- ./bin/grabpl artifacts docker publish --version-tag ${TAG} --dockerhub-repo grafana - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana --base alpine --base
--base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag ${TAG}
depends_on: depends_on:
- fetch-images-oss - fetch-images-oss
environment: environment:
@ -2435,8 +2466,8 @@ steps:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- ./bin/grabpl artifacts docker publish --version-tag ${TAG} --dockerhub-repo grafana-oss - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana-oss --base alpine
--base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag ${TAG}
depends_on: depends_on:
- fetch-images-oss - fetch-images-oss
environment: environment:
@ -2474,7 +2505,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2496,8 +2527,8 @@ steps:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- ./bin/grabpl artifacts docker publish --version-tag ${TAG} --dockerhub-repo grafana-enterprise - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana-enterprise --base
--base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag ${TAG}
depends_on: depends_on:
- fetch-images-enterprise - fetch-images-enterprise
environment: environment:
@ -2535,7 +2566,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2557,8 +2588,8 @@ steps:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- ./bin/grabpl artifacts docker publish --security --version-tag ${TAG} --dockerhub-repo - ./bin/grabpl artifacts docker publish --security --dockerhub-repo grafana --base
grafana --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag ${TAG}
depends_on: depends_on:
- fetch-images-oss - fetch-images-oss
environment: environment:
@ -2574,8 +2605,9 @@ steps:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- ./bin/grabpl artifacts docker publish --security --version-tag ${TAG} --dockerhub-repo - ./bin/grabpl artifacts docker publish --security --dockerhub-repo grafana-oss
grafana-oss --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag
${TAG}
depends_on: depends_on:
- fetch-images-oss - fetch-images-oss
environment: environment:
@ -2613,7 +2645,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2635,9 +2667,9 @@ steps:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- ./bin/grabpl artifacts docker publish --security --version-tag ${TAG} --dockerhub-repo - ./bin/grabpl artifacts docker publish --security --dockerhub-repo grafana-enterprise
grafana-enterprise --base alpine --base ubuntu --arch amd64 --arch arm64 --arch --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag
armv7 ${TAG}
depends_on: depends_on:
- fetch-images-enterprise - fetch-images-enterprise
environment: environment:
@ -2675,7 +2707,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2711,7 +2743,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2758,7 +2790,7 @@ steps:
name: initialize name: initialize
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2806,7 +2838,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2871,7 +2903,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -2966,8 +2998,6 @@ steps:
image: grafana/build-container:1.4.9 image: grafana/build-container:1.4.9
name: copy-packages-for-docker name: copy-packages-for-docker
- commands: - commands:
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
- ./bin/grabpl build-docker --edition oss --shouldSave - ./bin/grabpl build-docker --edition oss --shouldSave
depends_on: depends_on:
- copy-packages-for-docker - copy-packages-for-docker
@ -2975,13 +3005,11 @@ steps:
GCP_KEY: GCP_KEY:
from_secret: gcp_key from_secret: gcp_key
image: google/cloud-sdk image: google/cloud-sdk
name: package-docker-images name: build-docker-images
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
- ./bin/grabpl build-docker --edition oss --shouldSave --ubuntu - ./bin/grabpl build-docker --edition oss --shouldSave --ubuntu
depends_on: depends_on:
- copy-packages-for-docker - copy-packages-for-docker
@ -2989,7 +3017,7 @@ steps:
GCP_KEY: GCP_KEY:
from_secret: gcp_key from_secret: gcp_key
image: google/cloud-sdk image: google/cloud-sdk
name: package-docker-images-ubuntu name: build-docker-images-ubuntu
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
@ -3134,7 +3162,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -3248,7 +3276,7 @@ services:
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -3325,7 +3353,7 @@ steps:
name: identify-runner name: identify-runner
- commands: - commands:
- $$ProgressPreference = "SilentlyContinue" - $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/windows/grabpl.exe - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/windows/grabpl.exe
-OutFile grabpl.exe -OutFile grabpl.exe
image: grafana/ci-wix:0.1.1 image: grafana/ci-wix:0.1.1
name: initialize name: initialize
@ -3373,7 +3401,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -3499,8 +3527,6 @@ steps:
image: grafana/build-container:1.4.9 image: grafana/build-container:1.4.9
name: copy-packages-for-docker name: copy-packages-for-docker
- commands: - commands:
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
- ./bin/grabpl build-docker --edition enterprise --shouldSave - ./bin/grabpl build-docker --edition enterprise --shouldSave
depends_on: depends_on:
- copy-packages-for-docker - copy-packages-for-docker
@ -3508,13 +3534,11 @@ steps:
GCP_KEY: GCP_KEY:
from_secret: gcp_key from_secret: gcp_key
image: google/cloud-sdk image: google/cloud-sdk
name: package-docker-images name: build-docker-images
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
- commands: - commands:
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
- ./bin/grabpl build-docker --edition enterprise --shouldSave --ubuntu - ./bin/grabpl build-docker --edition enterprise --shouldSave --ubuntu
depends_on: depends_on:
- copy-packages-for-docker - copy-packages-for-docker
@ -3522,7 +3546,7 @@ steps:
GCP_KEY: GCP_KEY:
from_secret: gcp_key from_secret: gcp_key
image: google/cloud-sdk image: google/cloud-sdk
name: package-docker-images-ubuntu name: build-docker-images-ubuntu
volumes: volumes:
- name: docker - name: docker
path: /var/run/docker.sock path: /var/run/docker.sock
@ -3712,7 +3736,7 @@ services: []
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -3877,7 +3901,7 @@ services:
steps: steps:
- commands: - commands:
- mkdir -p bin - mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/grabpl - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl - chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8 image: byrnedo/alpine-curl:0.1.8
name: grabpl name: grabpl
@ -3997,7 +4021,7 @@ steps:
name: identify-runner name: identify-runner
- commands: - commands:
- $$ProgressPreference = "SilentlyContinue" - $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.8/windows/grabpl.exe - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/windows/grabpl.exe
-OutFile grabpl.exe -OutFile grabpl.exe
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise - cd grafana-enterprise
@ -4194,6 +4218,6 @@ kind: secret
name: gcp_upload_artifacts_key name: gcp_upload_artifacts_key
--- ---
kind: signature kind: signature
hmac: b697c1d027af3dec4cb90c9b5f0ccd15359a3af60685338f258c74efd0e45aa5 hmac: 5c4a8e18a79c5031b622d3c54a571d91683dc7ccf73115eae29dc95cf5216a19
... ...

@ -21,6 +21,7 @@ load(
'build_frontend_docs_step', 'build_frontend_docs_step',
'copy_packages_for_docker_step', 'copy_packages_for_docker_step',
'build_docker_images_step', 'build_docker_images_step',
'publish_images_step',
'postgres_integration_tests_step', 'postgres_integration_tests_step',
'mysql_integration_tests_step', 'mysql_integration_tests_step',
'redis_integration_tests_step', 'redis_integration_tests_step',
@ -111,8 +112,10 @@ def get_steps(edition, is_downstream=False):
frontend_metrics_step(edition=edition), frontend_metrics_step(edition=edition),
build_frontend_docs_step(edition=edition), build_frontend_docs_step(edition=edition),
copy_packages_for_docker_step(), copy_packages_for_docker_step(),
build_docker_images_step(edition=edition, ver_mode=ver_mode, publish=publish), build_docker_images_step(edition=edition, ver_mode=ver_mode, publish=False),
build_docker_images_step(edition=edition, ver_mode=ver_mode, ubuntu=True, publish=publish), build_docker_images_step(edition=edition, ver_mode=ver_mode, ubuntu=True, publish=False),
publish_images_step(edition=edition, ver_mode=ver_mode, mode='', docker_repo='grafana', ubuntu=False),
publish_images_step(edition=edition, ver_mode=ver_mode, mode='', docker_repo='grafana-oss', ubuntu=True)
]) ])
if include_enterprise2: if include_enterprise2:

@ -23,7 +23,7 @@ load(
'e2e_tests_artifacts', 'e2e_tests_artifacts',
'build_storybook_step', 'build_storybook_step',
'copy_packages_for_docker_step', 'copy_packages_for_docker_step',
'package_docker_images_step', 'build_docker_images_step',
'postgres_integration_tests_step', 'postgres_integration_tests_step',
'mysql_integration_tests_step', 'mysql_integration_tests_step',
'redis_integration_tests_step', 'redis_integration_tests_step',
@ -36,7 +36,8 @@ load(
'store_packages_step', 'store_packages_step',
'upload_cdn_step', 'upload_cdn_step',
'validate_scuemata_step', 'validate_scuemata_step',
'ensure_cuetsified_step' 'ensure_cuetsified_step',
'publish_images_step'
) )
load( load(
@ -117,27 +118,6 @@ def release_npm_packages_step():
], ],
} }
def publish_images_step(edition, mode, docker_repo):
if mode == 'security':
mode = '--{} '.format(mode)
else:
mode = ''
return {
'name': 'publish-images-{}'.format(docker_repo),
'image': 'google/cloud-sdk',
'environment': {
'GCP_KEY': from_secret('gcp_key'),
'DOCKER_USER': from_secret('docker_username'),
'DOCKER_PASSWORD': from_secret('docker_password'),
},
'commands': ['./bin/grabpl artifacts docker publish {}--version-tag ${{TAG}} --dockerhub-repo {} --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7'.format(mode, docker_repo)],
'depends_on': ['fetch-images-{}'.format(edition)],
'volumes': [{
'name': 'docker',
'path': '/var/run/docker.sock'
}],
}
def fetch_images_step(edition): def fetch_images_step(edition):
return { return {
'name': 'fetch-images-{}'.format(edition), 'name': 'fetch-images-{}'.format(edition),
@ -159,10 +139,10 @@ def publish_image_steps(version, mode, docker_repo, additional_docker_repo=""):
steps = [ steps = [
download_grabpl_step(), download_grabpl_step(),
fetch_images_step(version), fetch_images_step(version),
publish_images_step(version, mode, docker_repo), publish_images_step(version, 'release', mode, docker_repo),
] ]
if additional_docker_repo != "": if additional_docker_repo != "":
steps.extend([publish_images_step(version, mode, additional_docker_repo)]) steps.extend([publish_images_step(version, 'release', mode, additional_docker_repo)])
return steps return steps
@ -224,8 +204,8 @@ def get_steps(edition, ver_mode):
build_steps.extend([ build_steps.extend([
package_step(edition=edition, ver_mode=ver_mode, include_enterprise2=include_enterprise2), package_step(edition=edition, ver_mode=ver_mode, include_enterprise2=include_enterprise2),
copy_packages_for_docker_step(), copy_packages_for_docker_step(),
package_docker_images_step(edition=edition, ver_mode=ver_mode, publish=should_publish), build_docker_images_step(edition=edition, ver_mode=ver_mode, publish=True),
package_docker_images_step(edition=edition, ver_mode=ver_mode, ubuntu=True, publish=should_publish), build_docker_images_step(edition=edition, ver_mode=ver_mode, ubuntu=True, publish=True),
grafana_server_step(edition=edition), grafana_server_step(edition=edition),
]) ])

@ -1,9 +1,8 @@
load('scripts/drone/vault.star', 'from_secret', 'github_token', 'pull_secret', 'drone_token', 'prerelease_bucket') load('scripts/drone/vault.star', 'from_secret', 'github_token', 'pull_secret', 'drone_token', 'prerelease_bucket')
grabpl_version = 'v2.8.8' grabpl_version = 'v2.8.9'
build_image = 'grafana/build-container:1.4.9' build_image = 'grafana/build-container:1.4.9'
publish_image = 'grafana/grafana-ci-deploy:1.3.1' publish_image = 'grafana/grafana-ci-deploy:1.3.1'
grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2'
deploy_docker_image = 'us.gcr.io/kubernetes-dev/drone/plugins/deploy-image' deploy_docker_image = 'us.gcr.io/kubernetes-dev/drone/plugins/deploy-image'
alpine_image = 'alpine:3.15' alpine_image = 'alpine:3.15'
curl_image = 'byrnedo/alpine-curl:0.1.8' curl_image = 'byrnedo/alpine-curl:0.1.8'
@ -731,8 +730,11 @@ def copy_packages_for_docker_step():
} }
def package_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publish=False): def build_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publish=False):
cmd = './bin/grabpl build-docker --edition {} --shouldSave'.format(edition) cmd = './bin/grabpl build-docker --edition {}'.format(edition)
if publish:
cmd += ' --shouldSave'
ubuntu_sfx = '' ubuntu_sfx = ''
if ubuntu: if ubuntu:
ubuntu_sfx = '-ubuntu' ubuntu_sfx = '-ubuntu'
@ -742,12 +744,10 @@ def package_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publ
cmd += ' -archs {}'.format(','.join(archs)) cmd += ' -archs {}'.format(','.join(archs))
return { return {
'name': 'package-docker-images' + ubuntu_sfx, 'name': 'build-docker-images' + ubuntu_sfx,
'image': 'google/cloud-sdk', 'image': 'google/cloud-sdk',
'depends_on': ['copy-packages-for-docker'], 'depends_on': ['copy-packages-for-docker'],
'commands': [ 'commands': [
'printenv GCP_KEY | base64 -d > /tmp/gcpkey.json',
'gcloud auth activate-service-account --key-file=/tmp/gcpkey.json',
cmd cmd
], ],
'volumes': [{ 'volumes': [{
@ -759,27 +759,34 @@ def package_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publ
}, },
} }
def build_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publish=False): def publish_images_step(edition, ver_mode, mode, docker_repo, ubuntu=False):
ubuntu_sfx = '' if mode == 'security':
if ubuntu: mode = '--{} '.format(mode)
ubuntu_sfx = '-ubuntu' else:
mode = ''
settings = { cmd = './bin/grabpl artifacts docker publish {}--dockerhub-repo {} --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7'.format(mode, docker_repo)
'dry_run': not publish,
'edition': edition, if ver_mode == 'release':
'ubuntu': ubuntu, deps = ['fetch-images-{}'.format(edition)]
} cmd += ' --version-tag ${TAG}'
else:
deps = ['build-docker-images', 'build-docker-images-ubuntu']
if publish:
settings['username'] = from_secret('docker_user')
settings['password'] = from_secret('docker_password')
if archs:
settings['archs'] = ','.join(archs)
return { return {
'name': 'build-docker-images' + ubuntu_sfx, 'name': 'publish-images-{}'.format(docker_repo),
'image': grafana_docker_image, 'image': 'google/cloud-sdk',
'depends_on': ['copy-packages-for-docker'], 'environment': {
'settings': settings, 'GCP_KEY': from_secret('gcp_key'),
'DOCKER_USER': from_secret('docker_username'),
'DOCKER_PASSWORD': from_secret('docker_password'),
},
'commands': [cmd],
'depends_on': deps,
'volumes': [{
'name': 'docker',
'path': '/var/run/docker.sock'
}],
} }

Loading…
Cancel
Save