-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
101 lines (90 loc) · 1.63 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
stages:
- register
- images
- unregister
- multi-arch
.image:
image: docker:stable
stage: images
services:
- docker:stable-dind
variables:
DOCKER_DRIVER: overlay2
before_script:
- export RUNNER_ARCH=$(echo $CI_JOB_NAME|sed 's,.*:,,g')
- export RUN_AS_PLATFORM="${RUNNER_ARCH}"
- apk add --no-cache make bash
script:
- make all
tags:
- docker
- arm64
.runner:
image:
name: hashicorp/terraform:0.14.7
entrypoint: [""]
before_script:
- export RUNNER_ARCH=$(echo $CI_JOB_NAME|sed 's,.*:,,g')
- export TASK=$(echo $CI_JOB_NAME|sed 's,:.*$,,g')
- cd ci/aws/$RUNNER_ARCH
- terraform init
script:
- terraform $TASK -auto-approve
apply:arm:
extends: .runner
stage: register
test:arm:
extends: .image
script:
- make build
except:
- master
needs:
- apply:arm
img:arm:
extends: .image
only:
- master
environment:
name: arm/docker_images
url: https://hub.docker.com/r/klud/gitlab-runner/tags/
needs:
- apply:arm
destroy:arm:
extends: .runner
stage: unregister
when: always
apply:arm64:
extends: .runner
stage: register
test:arm64:
extends: .image
script:
- make build
except:
- master
needs:
- apply:arm64
img:arm64:
extends: .image
only:
- master
environment:
name: arm/docker_images
url: https://hub.docker.com/r/klud/gitlab-runner/tags/
needs:
- apply:arm64
destroy:arm64:
extends: .runner
stage: unregister
when: always
arch-tag:
stage: multi-arch
image: ulm0/manifest-tool:1.0.0
script:
- make multi-arch
only:
- master
needs:
- img:arm
- img:arm64