-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
117 lines (108 loc) · 4 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
image: docker
services:
- docker:dind
stages:
- build
- manifest
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
before_script:
- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
- export SANITIZED_BRANCH="$(echo $CI_COMMIT_REF_NAME | sed -r 's#^release/##' | sed 's/\//_/g')"
- export SANITIZED_ROLLING_BRANCH=${SANITIZED_BRANCH}-rolling
- export BUILD_TYPE=develop
build:
stage: build
script:
- if [ "${SANITIZED_BRANCH}" != "develop" ]; then export BUILD_TYPE=stable; fi
- >
docker build --build-arg RELEASE_TYPE=$BUILD_TYPE
-t ${ORG_NAME}/workspaces:$(arch)-$SANITIZED_BRANCH
.
- docker push ${ORG_NAME}/workspaces:$(arch)-$SANITIZED_BRANCH
only:
- develop
- /^release\/.*$/
except:
- schedules
tags:
- ${TAG}
parallel:
matrix:
- TAG: [ oci-fixed-amd, oci-fixed-arm ]
build_dev:
stage: build
script:
- >
docker build
-t ${ORG_NAME}/workspaces-private:$(arch)-$SANITIZED_BRANCH
.
- docker push ${ORG_NAME}/workspaces-private:$(arch)-$SANITIZED_BRANCH
except:
- develop
- /^release\/.*$/
tags:
- ${TAG}
parallel:
matrix:
- TAG: [ oci-fixed-amd, oci-fixed-arm ]
build_scheduled:
stage: build
script:
- if [ "${SANITIZED_ROLLING_BRANCH}" != "develop-rolling" ]; then export BUILD_TYPE=stable; fi
- >
docker build --build-arg RELEASE_TYPE=$BUILD_TYPE
-t ${ORG_NAME}/workspaces:$(arch)-$SANITIZED_ROLLING_BRANCH
.
- docker push ${ORG_NAME}/workspaces:$(arch)-$SANITIZED_ROLLING_BRANCH
only:
- schedules
tags:
- ${TAG}
parallel:
matrix:
- TAG: [ oci-fixed-amd, oci-fixed-arm ]
manifest:
stage: manifest
script:
- docker pull ${ORG_NAME}/workspaces:x86_64-$SANITIZED_BRANCH
- docker pull ${ORG_NAME}/workspaces:aarch64-$SANITIZED_BRANCH
- "docker manifest push --purge ${ORG_NAME}/workspaces:$SANITIZED_BRANCH || :"
- docker manifest create ${ORG_NAME}/workspaces:$SANITIZED_BRANCH ${ORG_NAME}/workspaces:x86_64-$SANITIZED_BRANCH ${ORG_NAME}/workspaces:aarch64-$SANITIZED_BRANCH
- docker manifest annotate ${ORG_NAME}/workspaces:$SANITIZED_BRANCH ${ORG_NAME}/workspaces:aarch64-$SANITIZED_BRANCH --os linux --arch arm64 --variant v8
- docker manifest push --purge ${ORG_NAME}/workspaces:$SANITIZED_BRANCH
only:
- develop
- /^release\/.*$/
except:
- schedules
tags:
- oci-fixed-amd
manifest_dev:
stage: manifest
script:
- docker pull ${ORG_NAME}/workspaces-private:x86_64-$SANITIZED_BRANCH
- docker pull ${ORG_NAME}/workspaces-private:aarch64-$SANITIZED_BRANCH
- "docker manifest push --purge ${ORG_NAME}/workspaces-private:$SANITIZED_BRANCH || :"
- docker manifest create ${ORG_NAME}/workspaces-private:$SANITIZED_BRANCH ${ORG_NAME}/workspaces-private:x86_64-$SANITIZED_BRANCH ${ORG_NAME}/workspaces-private:aarch64-$SANITIZED_BRANCH
- docker manifest annotate ${ORG_NAME}/workspaces-private:$SANITIZED_BRANCH ${ORG_NAME}/workspaces-private:aarch64-$SANITIZED_BRANCH --os linux --arch arm64 --variant v8
- docker manifest push --purge ${ORG_NAME}/workspaces-private:$SANITIZED_BRANCH
except:
- develop
- /^release\/.*$/
tags:
- oci-fixed-amd
manifest_scheduled:
stage: manifest
script:
- docker pull ${ORG_NAME}/workspaces:x86_64-$SANITIZED_ROLLING_BRANCH
- docker pull ${ORG_NAME}/workspaces:aarch64-$SANITIZED_ROLLING_BRANCH
- "docker manifest push --purge ${ORG_NAME}/workspaces:$SANITIZED_ROLLING_BRANCH || :"
- docker manifest create ${ORG_NAME}/workspaces:$SANITIZED_ROLLING_BRANCH ${ORG_NAME}/workspaces:x86_64-$SANITIZED_ROLLING_BRANCH ${ORG_NAME}/workspaces:aarch64-$SANITIZED_ROLLING_BRANCH
- docker manifest annotate ${ORG_NAME}/workspaces:$SANITIZED_ROLLING_BRANCH ${ORG_NAME}/workspaces:aarch64-$SANITIZED_ROLLING_BRANCH --os linux --arch arm64 --variant v8
- docker manifest push --purge ${ORG_NAME}/workspaces:$SANITIZED_ROLLING_BRANCH
only:
- schedules
tags:
- oci-fixed-amd