docker-qemu-reactos/.gitlab-ci.yml

98 lines
2.4 KiB
YAML
Raw Permalink Normal View History

2019-02-20 22:10:38 +00:00
stages:
2019-12-12 12:04:47 +00:00
- 'build:images'
- 'push:images'
2021-08-02 19:06:18 +00:00
- 'push:manifests'
2019-02-20 22:10:38 +00:00
variables:
2019-12-12 12:04:47 +00:00
DOCKER_HOST: 'tcp://dockerd:2376'
DOCKER_TLS_SAN: 'DNS:dockerd'
DOCKER_TLS_CERTDIR: '/certs'
DOCKER_DRIVER: 'overlay2'
2019-02-20 22:10:38 +00:00
2019-09-15 08:22:49 +00:00
default:
image: 'docker.io/docker:latest'
2019-09-15 08:22:49 +00:00
services:
2019-12-12 12:04:47 +00:00
- name: 'docker.io/docker:dind'
alias: 'dockerd'
2019-09-15 08:22:49 +00:00
2021-08-02 19:06:18 +00:00
.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:
- &regex_version '/^v[0-9]+$/'
build:images:native:
2019-12-12 12:04:47 +00:00
stage: 'build:images'
2021-08-02 19:06:18 +00:00
except: [*regex_version]
2019-02-20 22:10:38 +00:00
before_script:
2021-08-02 19:06:18 +00:00
- *cmd_install_build_packages
2019-02-20 22:10:38 +00:00
script:
2021-08-02 19:06:18 +00:00
- 'make IMAGE_BUILD_OPTS="--pull" build-native-image save-native-image'
2019-02-20 22:10:38 +00:00
artifacts:
2019-12-12 12:04:47 +00:00
expire_in: '1 day'
2019-02-20 22:10:38 +00:00
paths:
2019-12-12 12:04:47 +00:00
- './dist/'
2019-02-20 22:10:38 +00:00
2021-08-02 19:06:18 +00:00
.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:
2019-12-12 12:04:47 +00:00
stage: 'push:images'
2021-08-02 19:06:18 +00:00
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'
2019-02-20 22:10:38 +00:00
before_script:
2021-08-02 19:06:18 +00:00
- *cmd_install_push_packages
- *cmd_docker_login_registry
2019-02-20 22:10:38 +00:00
script:
2021-08-02 19:06:18 +00:00
- 'make push-cross-manifest'