forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathci_images.star
66 lines (62 loc) · 1.93 KB
/
ci_images.star
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
"""
This module contains steps and pipelines relating to creating CI Docker images.
"""
load(
"scripts/drone/utils/utils.star",
"pipeline",
)
load(
"scripts/drone/utils/windows_images.star",
"windows_images",
)
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,
platform = "windows",
steps = [
{
"name": "clone",
"image": windows_images["wix"],
"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": windows_images["windows_server_core"],
"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]