forked from hectorm/docker-qemu-win2000
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
97 lines (83 loc) · 2.37 KB
/
.gitlab-ci.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
stages:
- 'build:images'
- 'push:images'
- 'push:manifests'
variables:
DOCKER_HOST: 'tcp://dockerd:2376'
DOCKER_TLS_SAN: 'DNS:dockerd'
DOCKER_TLS_CERTDIR: '/certs'
DOCKER_DRIVER: 'overlay2'
default:
image: 'docker.io/docker:latest'
services:
- name: 'docker.io/docker:dind'
alias: 'dockerd'
.cmds:
- &cmd_install_build_packages 'apk add --no-cache coreutils git m4 make zstd'
- &cmd_install_push_packages 'apk add --no-cache coreutils git make zstd'
- &cmd_docker_login_registry 'docker login -u "${CI_REGISTRY_USER:?}" -p "${CI_REGISTRY_PASSWORD:?}" "${CI_REGISTRY:?}"'
.regexes:
- ®ex_version '/^v[0-9]+$/'
build:images:native:
stage: 'build:images'
except: [*regex_version]
before_script:
- *cmd_install_build_packages
script:
- 'make IMAGE_BUILD_OPTS="--pull" build-native-image save-native-image'
artifacts:
expire_in: '1 day'
paths:
- './dist/'
.build:images:cross:
stage: 'build:images'
only: [*regex_version]
before_script:
- *cmd_install_build_packages
script:
- 'make binfmt-register'
- 'make IMAGE_BUILD_OPTS="--pull" "build-${ARCH:?}-image" "save-${ARCH:?}-image"'
artifacts:
expire_in: '1 week'
paths:
- './dist/'
build:images:amd64:
extends: '.build:images:cross'
variables: {ARCH: 'amd64'}
build:images:arm64v8:
extends: '.build:images:cross'
variables: {ARCH: 'arm64v8'}
build:images:arm32v7:
extends: '.build:images:cross'
variables: {ARCH: 'arm32v7'}
.push:images:cross:
stage: 'push:images'
only: [*regex_version]
before_script:
- *cmd_install_push_packages
- *cmd_docker_login_registry
script:
- 'make "load-${ARCH:?}-image" "push-${ARCH:?}-image"'
push:images:amd64:
extends: '.push:images:cross'
dependencies: ['build:images:amd64']
variables: {ARCH: 'amd64'}
push:images:arm64v8:
extends: '.push:images:cross'
dependencies: ['build:images:arm64v8']
variables: {ARCH: 'arm64v8'}
push:images:arm32v7:
extends: '.push:images:cross'
dependencies: ['build:images:arm32v7']
variables: {ARCH: 'arm32v7'}
push:manifests:cross:
stage: 'push:manifests'
dependencies: ['push:images:amd64', 'push:images:arm64v8', 'push:images:arm32v7']
only: [*regex_version]
variables:
DOCKER_CLI_EXPERIMENTAL: 'enabled'
before_script:
- *cmd_install_push_packages
- *cmd_docker_login_registry
script:
- 'make push-cross-manifest'