CI: Add Windows backend tests in more places (#66438)

* CI: Add Windows backend tests in more places

* CI: Add promotion pipeline for publishing new windows-test-images

* CI: Ignore windows backend-test failures for now

* CI: Fix linting issue in ci_images.star file
This commit is contained in:
Horst Gutmann
2023-05-08 15:22:34 +02:00
committed by GitHub
parent e7f11f2456
commit b2fc285a5d
10 changed files with 676 additions and 12 deletions
+67
View File
@@ -0,0 +1,67 @@
"""
This module contains steps and pipelines relating to creating CI Docker images.
"""
load(
"scripts/drone/steps/lib.star",
"wix_image",
)
load(
"scripts/drone/utils/utils.star",
"pipeline",
)
load(
"scripts/drone/vault.star",
"from_secret",
)
def publish_ci_windows_test_image_pipeline():
trigger = {
"event": ["promote"],
"target": ["ci-windows-test-image"],
}
pl = pipeline(
name = "publish-ci-windows-test-image",
trigger = trigger,
edition = "",
platform = "windows",
steps = [
{
"name": "clone",
"image": wix_image,
"environment": {
"GITHUB_TOKEN": from_secret("github_token"),
},
"commands": [
'git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-ci-sandbox.git" .',
"git checkout -f $$env:DRONE_COMMIT",
],
},
{
"name": "build-and-publish",
"image": "docker:windowsservercore-1809",
"environment": {
"DOCKER_USERNAME": from_secret("docker_username"),
"DOCKER_PASSWORD": from_secret("docker_password"),
},
"commands": [
"cd scripts\\build\\ci-windows-test",
"docker login -u $$env:DOCKER_USERNAME -p $$env:DOCKER_PASSWORD",
"docker build -t grafana/grafana-ci-windows-test:$$env:TAG .",
"docker push grafana/grafana-ci-windows-test:$$env:TAG",
],
"volumes": [
{
"name": "docker",
"path": "//./pipe/docker_engine/",
},
],
},
],
)
pl["clone"] = {
"disable": True,
}
return [pl]
+40
View File
@@ -9,8 +9,48 @@ load(
load(
"scripts/drone/steps/lib.star",
"get_windows_steps",
"windows_go_image",
"windows_init_enterprise_steps",
"windows_test_backend_step",
"windows_wire_install_step",
)
def windows_test_backend(trigger, edition, ver_mode):
""" Generates a pipeline that runs backend tests on Windows
Args:
trigger: a Drone trigger for the pipeline
edition: controls whether enterprise code is included or not
ver_mode: controls whether a pre-release or actual release pipeline is generated.
Returns:
A single pipeline running backend tests for Windows
"""
environment = {"EDITION": edition}
steps = []
if edition == "enterprise":
steps.extend(windows_init_enterprise_steps(ver_mode))
else:
steps.extend([{
"name": "windows-init",
"image": windows_go_image,
"commands": [],
}])
steps.extend([
windows_wire_install_step(edition),
windows_test_backend_step(),
])
return pipeline(
name = "{}-{}-test-backend-windows".format(ver_mode, edition),
edition = edition,
trigger = trigger,
steps = steps,
depends_on = [],
platform = "windows",
environment = environment,
)
def windows(trigger, edition, ver_mode):
"""Generates the pipeline used for building Grafana on Windows.