diff --git a/.drone.yml b/.drone.yml index 565a6455db3..d164fafc4b3 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.7/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 @@ -110,7 +110,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -276,15 +276,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 @@ -326,7 +329,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -397,7 +400,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -497,7 +500,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -705,30 +708,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: @@ -814,7 +853,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -892,7 +931,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -905,10 +944,11 @@ steps: - rm gcpkey.json - cp C:\App\nssm-2.24.zip . - .\grabpl.exe gen-version --build-id $$env:DRONE_BUILD_NUMBER - - .\grabpl.exe windows-installer --edition oss --build-id $$env:DRONE_BUILD_NUMBER + - .\grabpl.exe windows-installer --edition oss --packages-bucket grafana-downloads + --build-id $$env:DRONE_BUILD_NUMBER - $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0] - - gsutil cp $$fname gs://%PRERELEASE_BUCKET%/artifacts/downloads/oss/main/ - - gsutil cp "$$fname.sha256" gs://%PRERELEASE_BUCKET%/artifacts/downloads/oss/main/ + - gsutil cp $$fname gs://grafana-downloads/oss/main/ + - gsutil cp "$$fname.sha256" gs://grafana-downloads/oss/main/ depends_on: - initialize environment: @@ -946,7 +986,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -1029,7 +1069,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -1127,8 +1167,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 @@ -1136,13 +1174,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 @@ -1150,7 +1186,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 @@ -1212,7 +1248,7 @@ steps: image: grafana/build-container:1.4.9 name: build-storybook - commands: - - ./bin/grabpl upload-cdn --edition oss --bucket "$${PRERELEASE_BUCKET}/artifacts/static-assets" + - ./bin/grabpl upload-cdn --edition oss --bucket "$${PRERELEASE_BUCKET}" depends_on: - grafana-server environment: @@ -1304,7 +1340,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -1424,7 +1460,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -1508,7 +1544,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -1567,7 +1603,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -1699,8 +1735,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 @@ -1708,13 +1742,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 @@ -1722,7 +1754,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 @@ -1776,7 +1808,7 @@ steps: image: cypress/included:8.4.1 name: end-to-end-tests-various-suite - commands: - - ./bin/grabpl upload-cdn --edition enterprise --bucket "$${PRERELEASE_BUCKET}/artifacts/static-assets" + - ./bin/grabpl upload-cdn --edition enterprise --bucket "$${PRERELEASE_BUCKET}" depends_on: - package environment: @@ -1819,7 +1851,7 @@ steps: image: grafana/build-container:1.4.9 name: package-enterprise2 - commands: - - ./bin/grabpl upload-cdn --edition enterprise2 --bucket "$${PRERELEASE_BUCKET}/artifacts/static-assets" + - ./bin/grabpl upload-cdn --edition enterprise2 --bucket "$${PRERELEASE_BUCKET}" depends_on: - package-enterprise2 environment: @@ -1877,7 +1909,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2049,7 +2081,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2177,7 +2209,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2252,7 +2284,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2274,8 +2306,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: @@ -2291,8 +2323,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: @@ -2330,7 +2362,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2352,8 +2384,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: @@ -2391,7 +2423,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2413,8 +2445,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: @@ -2430,8 +2462,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: @@ -2469,7 +2502,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2491,9 +2524,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: @@ -2531,7 +2564,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2567,7 +2600,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2614,7 +2647,7 @@ steps: name: initialize - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2662,7 +2695,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2727,7 +2760,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -2822,8 +2855,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 @@ -2831,13 +2862,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 @@ -2845,7 +2874,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 @@ -2958,7 +2987,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -3071,7 +3100,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -3148,7 +3177,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -3196,7 +3225,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -3320,8 +3349,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 @@ -3329,13 +3356,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 @@ -3343,7 +3368,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 @@ -3501,7 +3526,7 @@ services: [] steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -3663,7 +3688,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -3781,7 +3806,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.7/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 @@ -3893,6 +3918,6 @@ kind: secret name: prerelease_bucket --- kind: signature -hmac: ccccf712cc34ebea0b3aaab48914f8019624b1838af29ec712e47b1f7bd9a104 +hmac: 0da106a38545ca721d8db7495f74dfedb04cd4535a43efb5dcbb8a76993f20da ... diff --git a/scripts/drone/pipelines/main.star b/scripts/drone/pipelines/main.star index f93c056ee48..420de691ba7 100644 --- a/scripts/drone/pipelines/main.star +++ b/scripts/drone/pipelines/main.star @@ -20,6 +20,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', @@ -107,8 +108,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 b0a1eddabaa..60f8e778e39 100644 --- a/scripts/drone/pipelines/release.star +++ b/scripts/drone/pipelines/release.star @@ -21,7 +21,7 @@ load( 'e2e_tests_step', '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', @@ -34,7 +34,8 @@ load( 'store_packages_step', 'upload_cdn_step', 'validate_scuemata_step', - 'ensure_cuetsified_step' + 'ensure_cuetsified_step', + 'publish_images_step' ) load( @@ -113,27 +114,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), @@ -155,10 +135,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 @@ -220,8 +200,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 ba4865b622e..3a13a8e3c65 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.7' +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' @@ -284,8 +283,10 @@ def store_storybook_step(edition, ver_mode): def upload_cdn_step(edition, ver_mode): + src_dir = '' if ver_mode == "release": - bucket = "$${PRERELEASE_BUCKET}/artifacts/static-assets" + bucket = "$${PRERELEASE_BUCKET}" + src_dir = " --src-dir artifacts/static-assets" else: bucket = "grafana-static-assets" @@ -694,8 +695,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' @@ -705,12 +709,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': [{ @@ -722,27 +724,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' + }], } @@ -867,8 +876,6 @@ def upload_packages_step(edition, ver_mode, is_downstream=False): if ver_mode == 'main' and edition in ('enterprise', 'enterprise2') and not is_downstream: return None - packages_bucket = ' --packages-bucket $${PRERELEASE_BUCKET}/artifacts/downloads' + enterprise2_suffix(edition) - if ver_mode == 'release': packages_bucket = '$${{PRERELEASE_BUCKET}}/artifacts/downloads{}'.format(enterprise2_suffix(edition)) cmd = './bin/grabpl upload-packages --edition {} --packages-bucket {}'.format(edition, packages_bucket) @@ -966,6 +973,8 @@ def get_windows_steps(edition, ver_mode, is_downstream=False): dir = 'release' else: dir = 'main' + bucket = 'grafana-downloads' + bucket_part = ' --packages-bucket {}'.format(bucket) if not is_downstream: build_no = 'DRONE_BUILD_NUMBER' else: