diff --git a/.drone.yml b/.drone.yml index 57f76889825..8214f48acd3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,7 +11,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -111,7 +111,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -309,15 +309,18 @@ steps: - package image: grafana/build-container:1.4.9 name: copy-packages-for-docker -- depends_on: +- commands: + - ./bin/grabpl build-docker --edition oss -archs amd64 + depends_on: - 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 - settings: - archs: amd64 - dry_run: true - edition: oss - ubuntu: false + volumes: + - name: docker + path: /var/run/docker.sock trigger: event: - pull_request @@ -359,7 +362,7 @@ services: steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -420,7 +423,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -521,7 +524,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -761,30 +764,66 @@ steps: - package image: grafana/build-container:1.4.9 name: copy-packages-for-docker -- depends_on: +- commands: + - ./bin/grabpl build-docker --edition oss + depends_on: - 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 - settings: - dry_run: false - edition: oss - password: - from_secret: docker_password - ubuntu: false - username: - from_secret: docker_user -- depends_on: + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - ./bin/grabpl build-docker --edition oss --ubuntu + depends_on: - 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 - settings: - dry_run: false - edition: oss - password: + volumes: + - name: docker + path: /var/run/docker.sock +- 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 - ubuntu: true - username: - from_secret: docker_user + DOCKER_USER: + from_secret: docker_username + 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: - ./scripts/circle-release-canary-packages.sh depends_on: @@ -870,7 +909,7 @@ services: steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -938,7 +977,7 @@ steps: name: identify-runner - commands: - $$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 image: grafana/ci-wix:0.1.1 name: initialize @@ -1021,7 +1060,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1104,7 +1143,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1202,8 +1241,6 @@ steps: image: grafana/build-container:1.4.9 name: copy-packages-for-docker - 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 depends_on: - copy-packages-for-docker @@ -1211,13 +1248,11 @@ steps: GCP_KEY: from_secret: gcp_key image: google/cloud-sdk - name: package-docker-images + name: build-docker-images volumes: - name: docker path: /var/run/docker.sock - 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 depends_on: - copy-packages-for-docker @@ -1225,7 +1260,7 @@ steps: GCP_KEY: from_secret: gcp_key image: google/cloud-sdk - name: package-docker-images-ubuntu + name: build-docker-images-ubuntu volumes: - name: docker path: /var/run/docker.sock @@ -1412,7 +1447,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1533,7 +1568,7 @@ services: steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1617,7 +1652,7 @@ steps: name: identify-runner - commands: - $$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 image: grafana/ci-wix:0.1.1 name: initialize @@ -1676,7 +1711,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1808,8 +1843,6 @@ steps: image: grafana/build-container:1.4.9 name: copy-packages-for-docker - 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 depends_on: - copy-packages-for-docker @@ -1817,13 +1850,11 @@ steps: GCP_KEY: from_secret: gcp_key image: google/cloud-sdk - name: package-docker-images + name: build-docker-images volumes: - name: docker path: /var/run/docker.sock - 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 depends_on: - copy-packages-for-docker @@ -1831,7 +1862,7 @@ steps: GCP_KEY: from_secret: gcp_key image: google/cloud-sdk - name: package-docker-images-ubuntu + name: build-docker-images-ubuntu volumes: - name: docker path: /var/run/docker.sock @@ -2020,7 +2051,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2193,7 +2224,7 @@ services: steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2321,7 +2352,7 @@ steps: name: identify-runner - commands: - $$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 - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise @@ -2396,7 +2427,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2418,8 +2449,8 @@ steps: - name: docker path: /var/run/docker.sock - commands: - - ./bin/grabpl artifacts docker publish --version-tag ${TAG} --dockerhub-repo grafana - --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 + - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana --base alpine --base + ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag ${TAG} depends_on: - fetch-images-oss environment: @@ -2435,8 +2466,8 @@ steps: - name: docker path: /var/run/docker.sock - commands: - - ./bin/grabpl artifacts docker publish --version-tag ${TAG} --dockerhub-repo grafana-oss - --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 + - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana-oss --base alpine + --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag ${TAG} depends_on: - fetch-images-oss environment: @@ -2474,7 +2505,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2496,8 +2527,8 @@ steps: - name: docker path: /var/run/docker.sock - commands: - - ./bin/grabpl artifacts docker publish --version-tag ${TAG} --dockerhub-repo grafana-enterprise - --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 + - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana-enterprise --base + alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag ${TAG} depends_on: - fetch-images-enterprise environment: @@ -2535,7 +2566,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2557,8 +2588,8 @@ steps: - name: docker path: /var/run/docker.sock - commands: - - ./bin/grabpl artifacts docker publish --security --version-tag ${TAG} --dockerhub-repo - grafana --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 + - ./bin/grabpl artifacts docker publish --security --dockerhub-repo grafana --base + alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag ${TAG} depends_on: - fetch-images-oss environment: @@ -2574,8 +2605,9 @@ steps: - name: docker path: /var/run/docker.sock - commands: - - ./bin/grabpl artifacts docker publish --security --version-tag ${TAG} --dockerhub-repo - grafana-oss --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 + - ./bin/grabpl artifacts docker publish --security --dockerhub-repo grafana-oss + --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag + ${TAG} depends_on: - fetch-images-oss environment: @@ -2613,7 +2645,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2635,9 +2667,9 @@ steps: - name: docker path: /var/run/docker.sock - commands: - - ./bin/grabpl artifacts docker publish --security --version-tag ${TAG} --dockerhub-repo - grafana-enterprise --base alpine --base ubuntu --arch amd64 --arch arm64 --arch - armv7 + - ./bin/grabpl artifacts docker publish --security --dockerhub-repo grafana-enterprise + --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7 --version-tag + ${TAG} depends_on: - fetch-images-enterprise environment: @@ -2675,7 +2707,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2711,7 +2743,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2758,7 +2790,7 @@ steps: name: initialize - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2806,7 +2838,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2871,7 +2903,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2966,8 +2998,6 @@ steps: image: grafana/build-container:1.4.9 name: copy-packages-for-docker - 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 depends_on: - copy-packages-for-docker @@ -2975,13 +3005,11 @@ steps: GCP_KEY: from_secret: gcp_key image: google/cloud-sdk - name: package-docker-images + name: build-docker-images volumes: - name: docker path: /var/run/docker.sock - 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 depends_on: - copy-packages-for-docker @@ -2989,7 +3017,7 @@ steps: GCP_KEY: from_secret: gcp_key image: google/cloud-sdk - name: package-docker-images-ubuntu + name: build-docker-images-ubuntu volumes: - name: docker path: /var/run/docker.sock @@ -3134,7 +3162,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3248,7 +3276,7 @@ services: steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3325,7 +3353,7 @@ steps: name: identify-runner - commands: - $$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 image: grafana/ci-wix:0.1.1 name: initialize @@ -3373,7 +3401,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3499,8 +3527,6 @@ steps: image: grafana/build-container:1.4.9 name: copy-packages-for-docker - 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 depends_on: - copy-packages-for-docker @@ -3508,13 +3534,11 @@ steps: GCP_KEY: from_secret: gcp_key image: google/cloud-sdk - name: package-docker-images + name: build-docker-images volumes: - name: docker path: /var/run/docker.sock - 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 depends_on: - copy-packages-for-docker @@ -3522,7 +3546,7 @@ steps: GCP_KEY: from_secret: gcp_key image: google/cloud-sdk - name: package-docker-images-ubuntu + name: build-docker-images-ubuntu volumes: - name: docker path: /var/run/docker.sock @@ -3712,7 +3736,7 @@ services: [] steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3877,7 +3901,7 @@ services: steps: - commands: - 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 image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3997,7 +4021,7 @@ steps: name: identify-runner - commands: - $$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 - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git" - cd grafana-enterprise @@ -4194,6 +4218,6 @@ kind: secret name: gcp_upload_artifacts_key --- kind: signature -hmac: b697c1d027af3dec4cb90c9b5f0ccd15359a3af60685338f258c74efd0e45aa5 +hmac: 5c4a8e18a79c5031b622d3c54a571d91683dc7ccf73115eae29dc95cf5216a19 ... diff --git a/scripts/drone/pipelines/main.star b/scripts/drone/pipelines/main.star index 9c65e7a0bc9..583f3854160 100644 --- a/scripts/drone/pipelines/main.star +++ b/scripts/drone/pipelines/main.star @@ -21,6 +21,7 @@ load( 'build_frontend_docs_step', 'copy_packages_for_docker_step', 'build_docker_images_step', + 'publish_images_step', 'postgres_integration_tests_step', 'mysql_integration_tests_step', 'redis_integration_tests_step', @@ -111,8 +112,10 @@ def get_steps(edition, is_downstream=False): frontend_metrics_step(edition=edition), build_frontend_docs_step(edition=edition), 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, ubuntu=True, 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=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: diff --git a/scripts/drone/pipelines/release.star b/scripts/drone/pipelines/release.star index 88be5a4a675..237f903e005 100644 --- a/scripts/drone/pipelines/release.star +++ b/scripts/drone/pipelines/release.star @@ -23,7 +23,7 @@ load( 'e2e_tests_artifacts', 'build_storybook_step', 'copy_packages_for_docker_step', - 'package_docker_images_step', + 'build_docker_images_step', 'postgres_integration_tests_step', 'mysql_integration_tests_step', 'redis_integration_tests_step', @@ -36,7 +36,8 @@ load( 'store_packages_step', 'upload_cdn_step', 'validate_scuemata_step', - 'ensure_cuetsified_step' + 'ensure_cuetsified_step', + 'publish_images_step' ) 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): return { 'name': 'fetch-images-{}'.format(edition), @@ -159,10 +139,10 @@ def publish_image_steps(version, mode, docker_repo, additional_docker_repo=""): steps = [ download_grabpl_step(), fetch_images_step(version), - publish_images_step(version, mode, docker_repo), + publish_images_step(version, 'release', mode, 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 @@ -224,8 +204,8 @@ def get_steps(edition, ver_mode): build_steps.extend([ package_step(edition=edition, ver_mode=ver_mode, include_enterprise2=include_enterprise2), copy_packages_for_docker_step(), - package_docker_images_step(edition=edition, ver_mode=ver_mode, publish=should_publish), - 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, publish=True), + build_docker_images_step(edition=edition, ver_mode=ver_mode, ubuntu=True, publish=True), grafana_server_step(edition=edition), ]) diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 6f2300e7887..1bc2ff0f46b 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -1,9 +1,8 @@ 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' 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' alpine_image = 'alpine:3.15' 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): - cmd = './bin/grabpl build-docker --edition {} --shouldSave'.format(edition) +def build_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publish=False): + cmd = './bin/grabpl build-docker --edition {}'.format(edition) + if publish: + cmd += ' --shouldSave' + ubuntu_sfx = '' if 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)) return { - 'name': 'package-docker-images' + ubuntu_sfx, + 'name': 'build-docker-images' + ubuntu_sfx, 'image': 'google/cloud-sdk', 'depends_on': ['copy-packages-for-docker'], 'commands': [ - 'printenv GCP_KEY | base64 -d > /tmp/gcpkey.json', - 'gcloud auth activate-service-account --key-file=/tmp/gcpkey.json', cmd ], '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): - ubuntu_sfx = '' - if ubuntu: - ubuntu_sfx = '-ubuntu' +def publish_images_step(edition, ver_mode, mode, docker_repo, ubuntu=False): + if mode == 'security': + mode = '--{} '.format(mode) + else: + mode = '' - settings = { - 'dry_run': not publish, - 'edition': edition, - 'ubuntu': ubuntu, - } + cmd = './bin/grabpl artifacts docker publish {}--dockerhub-repo {} --base alpine --base ubuntu --arch amd64 --arch arm64 --arch armv7'.format(mode, docker_repo) + + if ver_mode == 'release': + 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 { - 'name': 'build-docker-images' + ubuntu_sfx, - 'image': grafana_docker_image, - 'depends_on': ['copy-packages-for-docker'], - 'settings': settings, + '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': [cmd], + 'depends_on': deps, + 'volumes': [{ + 'name': 'docker', + 'path': '/var/run/docker.sock' + }], }