[v9.5.x] CI: Add rgm compatible windows msi pipeline (#71868)
CI: Add rgm compatible windows msi pipeline (#71678)
* Add rgm compatible windows msi pipeline
* Fix dependencies and platform
* Fix missing arg comment
* Fix linting issues
* Try to fix version on file path
* Fix dependency on verify release pipeline
(cherry picked from commit 4caa773401)
This commit is contained in:
committed by
GitHub
parent
443c6a796d
commit
994d78334a
+85
-18
@@ -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: 27727506f986e7a7d15499300125b1dd601ca317ce6151ffb1af48618b759d19
|
||||
hmac: b7b316fc1630b82ed70baa280ea83264b8de52b471f88b8b4436da8daa117171
|
||||
|
||||
...
|
||||
|
||||
+19
-1
@@ -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",
|
||||
),
|
||||
]
|
||||
|
||||
@@ -16,7 +16,7 @@ load(
|
||||
"windows_images",
|
||||
)
|
||||
|
||||
grabpl_version = "v3.0.39"
|
||||
grabpl_version = "v3.0.40"
|
||||
|
||||
trigger_oss = {
|
||||
"repo": [
|
||||
@@ -1189,11 +1189,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.
|
||||
@@ -1223,13 +1224,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 = [
|
||||
@@ -1243,9 +1244,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]',
|
||||
@@ -1254,9 +1257,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,
|
||||
),
|
||||
],
|
||||
@@ -1265,12 +1268,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,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user