-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
84 lines (76 loc) · 1.78 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
services:
- docker:dind
.docker:
image: docker
before_script:
- docker info
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- export tag="linaro/kir:${CI_COMMIT_TAG}${TAG_APPEND}"
- export latest="linaro/kir:latest${TAG_APPEND}"
script:
- docker build --pull --tag "${tag}" --tag "${latest}" .
- docker push "${tag}"
- docker push "${latest}"
variables:
DOCKER_DRIVER: overlay2
docker-amd64:
extends: .docker
stage: build
variables:
TAG_APPEND: -amd64
only:
- tags
docker-arm64:
extends: .docker
stage: build
tags:
- saas-linux-medium-arm64
variables:
TAG_APPEND: -arm64
only:
- tags
.docker-master:
extends: .docker
stage: build
variables:
IMAGE_NAME: "linaro/kir:master"
script:
- docker build --pull --tag "${IMAGE_NAME}${TAG_APPEND}" .
- docker push "${IMAGE_NAME}${TAG_APPEND}"
only:
- master
docker-master-amd64:
extends: .docker-master
stage: build
variables:
TAG_APPEND: -amd64
docker-master-arm64:
extends: .docker-master
stage: build
tags:
- saas-linux-medium-arm64
variables:
TAG_APPEND: -arm64
publish-dockerhub:
extends: .docker
stage: deploy
variables:
DOCKER_CLI_EXPERIMENTAL: "enabled"
script:
- docker manifest create "${tag}" "${tag}-amd64" "${tag}-arm64"
- docker manifest create "${latest}" "${latest}-amd64" "${latest}-arm64"
- docker manifest push "${tag}"
- docker manifest push "${latest}"
only:
- tags
publish-master-dockerhub:
extends: .docker
stage: deploy
variables:
DOCKER_CLI_EXPERIMENTAL: "enabled"
IMAGE_NAME: "linaro/kir:master"
script:
- docker manifest create "${IMAGE_NAME}" "${IMAGE_NAME}-amd64" "${IMAGE_NAME}-arm64"
- docker manifest push "${IMAGE_NAME}"
only:
- master