diff --git a/.drone.yml b/.drone.yml index 9aae82dc826..28afe5c1f87 100644 --- a/.drone.yml +++ b/.drone.yml @@ -120,7 +120,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -465,7 +465,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -852,7 +852,7 @@ steps: name: clone-enterprise - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1149,7 +1149,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1399,7 +1399,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1842,7 +1842,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -1958,7 +1958,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/windows/grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/windows/grabpl.exe -OutFile grabpl.exe image: grafana/ci-wix:0.1.1 name: windows-init @@ -2158,7 +2158,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2461,7 +2461,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -2599,7 +2599,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/windows/grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/windows/grabpl.exe -OutFile grabpl.exe image: grafana/ci-wix:0.1.1 name: windows-init @@ -2611,7 +2611,8 @@ steps: - gcloud auth activate-service-account --key-file=gcpkey.json - rm gcpkey.json - cp C:\App\nssm-2.24.zip . - - .\grabpl.exe windows-installer --edition oss ${DRONE_TAG} + - .\grabpl.exe windows-installer --target gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/oss/release/grafana-${DRONE_TAG:1}.windows-amd64.zip + --edition oss ${DRONE_TAG} - $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0] - gsutil cp $$fname gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/oss/release/ - gsutil cp "$$fname.sha256" gs://%PRERELEASE_BUCKET%/artifacts/downloads/${DRONE_TAG}/oss/release/ @@ -2663,7 +2664,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3180,6 +3181,72 @@ clone: retries: 3 depends_on: - rgm-tag-prerelease +environment: + EDITION: oss +image_pull_secrets: +- dockerconfigjson +kind: pipeline +name: rgm-tag-prerelease-windows +platform: + arch: amd64 + os: windows + version: "1809" +services: [] +steps: +- commands: + - echo $env:DRONE_RUNNER_NAME + image: mcr.microsoft.com/windows:1809 + name: identify-runner +- commands: + - $$ProgressPreference = "SilentlyContinue" + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/windows/grabpl.exe + -OutFile grabpl.exe + image: grafana/ci-wix:0.1.1 + name: windows-init +- commands: + - $$gcpKey = $$env:GCP_KEY + - '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey)) + > gcpkey.json' + - dos2unix gcpkey.json + - gcloud auth activate-service-account --key-file=gcpkey.json + - rm gcpkey.json + - cp C:\App\nssm-2.24.zip . + - .\grabpl.exe windows-installer --target gs://grafana-prerelease-dev/artifacts/downloads/${DRONE_TAG}/oss/release/grafana-${DRONE_TAG:1}.windows-amd64.zip + --edition oss ${DRONE_TAG} + - $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0] + - gsutil cp $$fname gs://grafana-prerelease-dev/artifacts/downloads/${DRONE_TAG}/oss/release/ + - gsutil cp "$$fname.sha256" gs://grafana-prerelease-dev/artifacts/downloads/${DRONE_TAG}/oss/release/ + depends_on: + - windows-init + environment: + GCP_KEY: + from_secret: gcp_key + GITHUB_TOKEN: + from_secret: github_token + PRERELEASE_BUCKET: + from_secret: prerelease_bucket + image: grafana/ci-wix:0.1.1 + name: build-windows-installer +trigger: + event: + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* +type: docker +volumes: +- host: + path: //./pipe/docker_engine/ + name: docker +--- +clone: + retries: 3 +depends_on: +- rgm-tag-prerelease +- rgm-tag-prerelease-windows image_pull_secrets: - dockerconfigjson kind: pipeline @@ -3242,7 +3309,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3521,7 +3588,7 @@ steps: name: identify-runner - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3662,7 +3729,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -3763,7 +3830,7 @@ steps: name: identify-runner - commands: - $$ProgressPreference = "SilentlyContinue" - - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/windows/grabpl.exe + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/windows/grabpl.exe -OutFile grabpl.exe image: grafana/ci-wix:0.1.1 name: windows-init @@ -3833,7 +3900,7 @@ services: steps: - commands: - mkdir -p bin - - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.39/grabpl + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.40/grabpl - chmod +x bin/grabpl image: byrnedo/alpine-curl:0.1.8 name: grabpl @@ -4401,6 +4468,6 @@ kind: secret name: github_token --- kind: signature -hmac: f0116e20032a6984e32c3611ea2562a3c30ff9214cebbc7e307927243bcb5616 +hmac: 15243b6abac63ca13532a017ba86125d60a03eb0574346e6bde9b187bf8599f6 ... diff --git a/scripts/drone/rgm.star b/scripts/drone/rgm.star index 2d78a8a8aaf..dc9a7e20db4 100644 --- a/scripts/drone/rgm.star +++ b/scripts/drone/rgm.star @@ -4,6 +4,10 @@ rgm uses 'github.com/grafana/grafana-build' to build Grafana on the following ev * A tag that begins with a 'v' """ +load( + "scripts/drone/steps/lib.star", + "get_windows_steps", +) load( "scripts/drone/utils/utils.star", "pipeline", @@ -99,14 +103,28 @@ def rgm_tag(): depends_on = [], ) +def rgm_windows(): + return pipeline( + name = "rgm-tag-prerelease-windows", + trigger = tag_trigger, + steps = get_windows_steps( + ver_mode = "release", + bucket = "grafana-prerelease-dev", + ), + depends_on = ["rgm-tag-prerelease"], + platform = "windows", + environment = {"EDITION": "oss"}, + ) + def rgm(): return [ rgm_main(), rgm_tag(), + rgm_windows(), verify_release_pipeline( name = "rgm-tag-verify-prerelease-assets", trigger = tag_trigger, - depends_on = ["rgm-tag-prerelease"], + depends_on = ["rgm-tag-prerelease", "rgm-tag-prerelease-windows"], bucket = "grafana-prerelease-dev", ), ] diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 9c526e694b8..2e6cfb0e7a7 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -16,7 +16,7 @@ load( "windows_images", ) -grabpl_version = "v3.0.39" +grabpl_version = "v3.0.40" trigger_oss = { "repo": [ @@ -1207,11 +1207,12 @@ def windows_clone_step(): ], } -def get_windows_steps(ver_mode): +def get_windows_steps(ver_mode, bucket = "%PRERELEASE_BUCKET%"): """Generate the list of Windows steps. Args: ver_mode: used to differentiate steps for different version modes. + bucket: used to override prerelease bucket. Returns: List of Drone steps. @@ -1241,13 +1242,13 @@ def get_windows_steps(ver_mode): "release", "release-branch", ): - bucket = "%PRERELEASE_BUCKET%/artifacts/downloads" + gcp_bucket = "{}/artifacts/downloads".format(bucket) if ver_mode == "release": ver_part = "${DRONE_TAG}" dir = "release" else: dir = "main" - bucket = "grafana-downloads" + gcp_bucket = "grafana-downloads" build_no = "DRONE_BUILD_NUMBER" ver_part = "--build-id $$env:{}".format(build_no) installer_commands = [ @@ -1261,9 +1262,11 @@ def get_windows_steps(ver_mode): ] if ver_mode in ("release",): + version = "${DRONE_TAG:1}" installer_commands.extend( [ - ".\\grabpl.exe windows-installer --edition oss {}".format( + ".\\grabpl.exe windows-installer --target {} --edition oss {}".format( + "gs://{}/{}/oss/{}/grafana-{}.windows-amd64.zip".format(gcp_bucket, ver_part, ver_mode, version), ver_part, ), '$$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0]', @@ -1272,9 +1275,9 @@ def get_windows_steps(ver_mode): if ver_mode == "main": installer_commands.extend( [ - "gsutil cp $$fname gs://{}/oss/{}/".format(bucket, dir), + "gsutil cp $$fname gs://{}/oss/{}/".format(gcp_bucket, dir), 'gsutil cp "$$fname.sha256" gs://{}/oss/{}/'.format( - bucket, + gcp_bucket, dir, ), ], @@ -1283,12 +1286,12 @@ def get_windows_steps(ver_mode): installer_commands.extend( [ "gsutil cp $$fname gs://{}/{}/oss/{}/".format( - bucket, + gcp_bucket, ver_part, dir, ), 'gsutil cp "$$fname.sha256" gs://{}/{}/oss/{}/'.format( - bucket, + gcp_bucket, ver_part, dir, ),