Update gitlab CI/CD to build multi-arch
This commit is contained in:
parent
a54183b4be
commit
5ce358e414
@ -1,23 +1,31 @@
|
|||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
- build-manifest
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
DOCKER_HOST: tcp://docker:2375
|
|
||||||
VERSION: latest
|
VERSION: latest
|
||||||
|
DOCKER_HOST: tcp://docker:2375
|
||||||
VERSIONARCH: ${VERSION}-${ARCH}
|
VERSIONARCH: ${VERSION}-${ARCH}
|
||||||
|
|
||||||
|
cache:
|
||||||
|
key: ${CI_JOB_NAME_SLUG}-${CI_COMMIT_REF_SLUG}
|
||||||
|
paths:
|
||||||
|
- build-cache
|
||||||
|
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- if [ ! -d build-cache ]; then mkdir build-cache; fi
|
- if [ ! -d build-cache ]; then mkdir build-cache; fi
|
||||||
- sed -ie s'/https/http/' /etc/apk/repositories
|
- sed -i -e s'/https/http/' /etc/apk/repositories
|
||||||
- HTTP_PROXY=http://proxy.dege.lan:3128 apk add git curl
|
- HTTP_PROXY=http://proxy.dege.lan:3128 apk add git curl
|
||||||
- docker info && docker version
|
- docker info && docker version
|
||||||
# env|sort
|
# env|sort
|
||||||
# docker login -u "$CI_DEPENDENCY_PROXY_USER" -p "$CI_DEPENDENCY_PROXY_PASSWORD" "$CI_SERVER_HOST"
|
|
||||||
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
|
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- .gitlab-docker-x86_64.yml
|
- .gitlab-docker-x86_64.yml
|
||||||
|
# .gitlab-docker-armv7l.yml
|
||||||
|
# .gitlab-docker-arm64.yml
|
||||||
|
- .gitlab-docker-manifest.yml
|
||||||
|
10
.gitlab-docker-manifest.yml
Normal file
10
.gitlab-docker-manifest.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
x86_64:build-manifest:
|
||||||
|
stage: build-manifest
|
||||||
|
script:
|
||||||
|
- docker manifest create ${CI_REGISTRY_IMAGE}:${VERSION} ${CI_REGISTRY_IMAGE}:${VERSION}-x86_64 #${CI_REGISTRY_IMAGE}:${VERSION}-arm64 ${CI_REGISTRY_IMAGE}:${VERSION}armv7l
|
||||||
|
- docker manifest push --purge ${CI_REGISTRY_IMAGE}:${VERSION}
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- x86_64
|
||||||
|
only:
|
||||||
|
- master
|
Loading…
Reference in New Issue
Block a user