This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
47 lines (44 loc) · 1.69 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
image: gitlab-registry-production.govcms.amazee.io/govcms/govcms-ci:latest
services:
- name: gitlab-registry-production.govcms.amazee.io/govcms/govcms-ci/dind:latest
command: ["--tls=false"]
stages:
- build
build:
stage: build
script:
- BUILDX_VERSION=$(docker buildx version|grep 'github.com/docker/buildx') || true
- IMAGE_TAG=$([ $CI_COMMIT_BRANCH = 'master' ] && echo 'latest' || echo 'edge')
- scripts/prepare
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- |
set -eux
if [ ! -z "${BUILDX_VERSION}" ]; then
docker buildx create --name govcms-ci-amd-arm --platform linux/amd64,linux/arm64
docker buildx ls
docker buildx bake -f docker-compose.yml -f bake.hcl --builder govcms-ci-amd-arm --push
else
docker build -f govcms-ci.Dockerfile -t $CI_REGISTRY/govcms/govcms-ci:${IMAGE_TAG} .
docker push $CI_REGISTRY/govcms/govcms-ci:${IMAGE_TAG}
docker pull docker:dind
docker tag docker:dind $CI_REGISTRY/govcms/govcms-ci/dind:latest
docker push $CI_REGISTRY/govcms/govcms-ci/dind:latest
fi
variables:
DOCKER_HOST: tcp://localhost:2375
only:
- develop
- master
build:creator-ee:
stage: build
script:
- |
set -eux
CREATOR_EE_VERSION=${CREATOR_EE_VERSION:-v0.5.2}
git clone -b ${CREATOR_EE_VERSION} https://github.com/ansible/creator-ee.git
cd creator-ee
docker build -t gitlab-registry-production.govcms.amazee.io/govcms/govcms-ci/ansible-creator-ee:${CREATOR_EE_VERSION} .
docker push gitlab-registry-production.govcms.amazee.io/govcms/govcms-ci/ansible-creator-ee:${CREATOR_EE_VERSION}
only:
- develop
- master