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

75 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2019-02-20 22:10:38 +00:00
stages:
2022-02-08 22:15:29 +00:00
- 'build'
- 'push'
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
2022-02-08 22:15:29 +00:00
.anchors:
- &cmd_install_packages 'apk add --no-cache coreutils git m4 make zstd'
- &cmd_docker_login_registry 'docker login -u "${CI_REGISTRY_USER:?}" -p "${CI_REGISTRY_PASSWORD:?}" "${CI_REGISTRY:?}"'
- &matrix_arch ['amd64', 'arm64v8', 'arm32v7']
2021-08-02 19:06:18 +00:00
- &regex_version '/^v[0-9]+$/'
2022-02-08 22:15:29 +00:00
build:native:
stage: 'build'
2021-08-02 19:06:18 +00:00
except: [*regex_version]
2019-02-20 22:10:38 +00:00
before_script:
2022-02-08 22:15:29 +00:00
- *cmd_install_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
2022-02-08 22:15:29 +00:00
build:cross:
stage: 'build'
2021-08-02 19:06:18 +00:00
only: [*regex_version]
2022-02-08 22:15:29 +00:00
parallel:
matrix:
- ARCH: *matrix_arch
2021-08-02 19:06:18 +00:00
before_script:
2022-02-08 22:15:29 +00:00
- *cmd_install_packages
2021-08-02 19:06:18 +00:00
script:
- 'make binfmt-register'
- 'make IMAGE_BUILD_OPTS="--pull" "build-${ARCH:?}-image" "save-${ARCH:?}-image"'
artifacts:
expire_in: '1 week'
paths:
- './dist/'
2022-02-08 22:15:29 +00:00
push:cross:
stage: 'push'
needs: ['build:cross']
2021-08-02 19:06:18 +00:00
only: [*regex_version]
2022-02-08 22:15:29 +00:00
parallel:
matrix:
- ARCH: *matrix_arch
2021-08-02 19:06:18 +00:00
before_script:
2022-02-08 22:15:29 +00:00
- *cmd_install_packages
2021-08-02 19:06:18 +00:00
- *cmd_docker_login_registry
script:
- 'make "load-${ARCH:?}-image" "push-${ARCH:?}-image"'
2022-02-08 22:15:29 +00:00
push:manifest:
stage: 'push'
needs: ['push:cross']
2021-08-02 19:06:18 +00:00
only: [*regex_version]
variables:
DOCKER_CLI_EXPERIMENTAL: 'enabled'
2019-02-20 22:10:38 +00:00
before_script:
2022-02-08 22:15:29 +00:00
- *cmd_install_packages
2021-08-02 19:06:18 +00:00
- *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'