-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
45 lines (42 loc) · 1.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
stages:
- main-build
variables:
CONTAINER_REGISTRIES: |
voxsoft/kube-synchro-scale
$CI_REGISTRY_IMAGE
Build:
stage: main-build
image: ezkrg/buildx:latest
tags:
- docker
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY_IMAGE
- docker login -u $CONTAINER_REGISTRY_USER -p $CONTAINER_REGISTRY_PASSWORD
## Create a set of tags for the image with multiple registries
- for REGISTRY in $CONTAINER_REGISTRIES; do
TAGS="$TAGS -t ${REGISTRY}:${CI_COMMIT_BRANCH}";
done
- docker buildx create --name mybuilder --use
- docker buildx build --provenance=false --platform linux/arm64/v8,linux/amd64 --push $TAGS .
except:
- tags
Release:
stage: main-build
image: ezkrg/buildx:latest
tags:
- docker
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY_IMAGE
- docker login -u $CONTAINER_REGISTRY_USER -p $CONTAINER_REGISTRY_PASSWORD
## Create a set of tags for the image with multiple registries
- for REGISTRY in $CONTAINER_REGISTRIES; do
TAGS="$TAGS -t ${REGISTRY}:${CI_COMMIT_TAG} -t ${REGISTRY}:latest";
done
- docker buildx create --name mybuilder --use
- docker buildx build --provenance=false --platform linux/arm64/v8,linux/amd64 --push $TAGS .
only:
- tags