-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
55 lines (50 loc) · 1.11 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
48
49
50
51
52
53
54
55
image: docker:20.10.23
variables:
DOCKER_TLS_CERTDIR: "/certs"
services:
- docker:20.10.23-dind
build:
stage: build
before_script:
- export
- docker info
- docker --version
- pwd
- ls -al
script:
- docker buildx bake --load
- mkdir image
- docker save $(docker buildx bake --print | grep ubuntu18.04 | cut -d '"' -f 2) -o image/images.tar
artifacts:
paths:
- image
tags:
- dind
test:
stage: test
needs:
- job: build
artifacts: true
script:
- docker load -i image/images.tar
- docker compose up -d gcc11 # to test if the builds worked, see if gcc11 container can be created
tags:
- dind
deploy:
stage: deploy
needs:
- job: build
artifacts: true
- job: test
artifacts: false
script:
- docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_TOKEN"
- docker load -i image/images.tar
- |
for image in $(docker buildx bake --print | grep ubuntu18.04 | cut -d '"' -f2)
do
docker image push $image& # Push all images in parallel
done
wait # wait for all pushes to finish
tags:
- dind