Skip to content

Commit 2bd463a

Browse files
thampiotrptodev
andauthored
Build Windows container image on GitHub Actions (#3204) (#3205)
* Build Windows container image on GitHub Actions (#3204) * update RC version --------- Co-authored-by: Paulin Todev <[email protected]>
1 parent 8d864ac commit 2bd463a

File tree

4 files changed

+38
-73
lines changed

4 files changed

+38
-73
lines changed

.drone/drone.yml

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -372,44 +372,9 @@ volumes:
372372
path: /var/run/docker.sock
373373
name: docker
374374
---
375-
kind: pipeline
376-
name: Publish Windows alloy container
377-
platform:
378-
arch: amd64
379-
os: windows
380-
version: "1809"
381-
steps:
382-
- commands:
383-
- '& "C:/Program Files/git/bin/bash.exe" -c ''mkdir -p $HOME/.docker'''
384-
- '& "C:/Program Files/git/bin/bash.exe" -c ''printenv GCR_CREDS > $HOME/.docker/config.json'''
385-
- '& "C:/Program Files/git/bin/bash.exe" -c ''docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD'''
386-
- '& "C:/Program Files/git/bin/bash.exe" -c ''./tools/ci/docker-containers-windows
387-
alloy'''
388-
environment:
389-
DOCKER_LOGIN:
390-
from_secret: docker_login
391-
DOCKER_PASSWORD:
392-
from_secret: docker_password
393-
GCR_CREDS:
394-
from_secret: gcr_admin
395-
image: grafana/alloy-build-image:v0.1.8-windows
396-
name: Build containers
397-
volumes:
398-
- name: docker
399-
path: //./pipe/docker_engine/
400-
trigger:
401-
ref:
402-
- refs/tags/v*
403-
type: docker
404-
volumes:
405-
- host:
406-
path: //./pipe/docker_engine/
407-
name: docker
408-
---
409375
depends_on:
410376
- Publish Linux alloy container
411377
- Publish Linux alloy-boringcrypto container
412-
- Publish Windows alloy container
413378
image_pull_secrets:
414379
- dockerconfigjson
415380
kind: pipeline
@@ -545,6 +510,6 @@ kind: secret
545510
name: updater_private_key
546511
---
547512
kind: signature
548-
hmac: 97f89e50b55b8aae91afb5a7708fe2b37c935ddc48c1a71d66bc0d56953fa68d
513+
hmac: 89ceb7461db70e853b2d0be511054b745584d503c3fd9b45961c991b47d99727
549514

550515
...

.drone/pipelines/publish.jsonnet

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ local linux_containers = [
1010
{ devel: 'alloy-devel', release: 'alloy' },
1111
{ devel: 'alloy-devel-boringcrypto', release: 'alloy-boringcrypto' },
1212
];
13-
local windows_containers = [
14-
{ devel: 'alloy-devel', release: 'alloy' },
15-
];
1613

1714
local linux_containers_jobs = std.map(function(container) (
1815
pipelines.linux('Publish Linux %s container' % container.release) {
@@ -65,44 +62,13 @@ local linux_containers_jobs = std.map(function(container) (
6562
), linux_containers);
6663

6764

68-
local windows_containers_jobs = std.map(function(container) (
69-
pipelines.windows('Publish Windows %s container' % container.release) {
70-
trigger: {
71-
ref: ['refs/tags/v*'],
72-
},
73-
steps: [{
74-
name: 'Build containers',
75-
image: build_image.windows,
76-
volumes: [{
77-
name: 'docker',
78-
path: '//./pipe/docker_engine/',
79-
}],
80-
environment: {
81-
DOCKER_LOGIN: secrets.docker_login.fromSecret,
82-
DOCKER_PASSWORD: secrets.docker_password.fromSecret,
83-
GCR_CREDS: secrets.gcr_admin.fromSecret,
84-
},
85-
commands: [
86-
pipelines.windows_command('mkdir -p $HOME/.docker'),
87-
pipelines.windows_command('printenv GCR_CREDS > $HOME/.docker/config.json'),
88-
pipelines.windows_command('docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD'),
89-
pipelines.windows_command('./tools/ci/docker-containers-windows %s' % container.release),
90-
],
91-
}],
92-
volumes: [{
93-
name: 'docker',
94-
host: { path: '//./pipe/docker_engine/' },
95-
}],
96-
}
97-
), windows_containers);
98-
99-
linux_containers_jobs + windows_containers_jobs + [
65+
linux_containers_jobs + [
10066

10167
pipelines.linux('Publish release') {
10268
trigger: {
10369
ref: ['refs/tags/v*'],
10470
},
105-
depends_on: job_names(linux_containers_jobs + windows_containers_jobs),
71+
depends_on: job_names(linux_containers_jobs),
10672
image_pull_secrets: ['dockerconfigjson'],
10773
steps: [
10874
{
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish alloy release containers
2+
# TODO: Reuse the config from publish-alloy-devel.yml
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
publish_windows_container:
14+
name: Publish Windows alloy container
15+
runs-on: windows-2022
16+
steps:
17+
# This step needs to run before "Checkout code".
18+
# That's because it generates a new file.
19+
# We don't want this file to end up in the repo directory.
20+
# Then "tools/image-tag" would get confused because "git status" no longer reports a clean repo.
21+
- name: Login to DockerHub (from vault)
22+
uses: grafana/shared-workflows/actions/[email protected]
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v5
29+
with:
30+
go-version-file: go.mod
31+
cache: false
32+
33+
- run: |
34+
& "C:/Program Files/git/bin/bash.exe" -c './tools/ci/docker-containers-windows alloy'

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This document contains a historical list of changes between releases. Only
77
changes that impact end-user behavior are listed; changes to documentation or
88
internal API changes are not present.
99

10-
v1.8.0-rc.1
10+
v1.8.0-rc.2
1111
-----------------
1212

1313
### Breaking changes

0 commit comments

Comments
 (0)