-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
101 lines (93 loc) · 3.58 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
image: docker
services:
- docker:dind
stages:
- build
- manifest
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
build-container:
stage: build
script:
- docker build -t ${ORG_NAME}/postgres:$(arch)-$SANITIZED_BRANCH .
- docker push ${ORG_NAME}/postgres:$(arch)-$SANITIZED_BRANCH
only:
- develop
- /^release\/.*$/
except:
- schedules
tags:
- ${TAG}
parallel:
matrix:
- TAG: [ aws-autoscale, aws-autoscale-arm64 ]
manifest-container:
stage: manifest
script:
- docker pull ${ORG_NAME}/postgres:x86_64-$SANITIZED_BRANCH
- docker pull ${ORG_NAME}/postgres:aarch64-$SANITIZED_BRANCH
- "docker manifest push --purge ${ORG_NAME}/postgres:$SANITIZED_BRANCH || :"
- docker manifest create ${ORG_NAME}/postgres:$SANITIZED_BRANCH ${ORG_NAME}/postgres:x86_64-$SANITIZED_BRANCH ${ORG_NAME}/postgres:aarch64-$SANITIZED_BRANCH
- docker manifest annotate ${ORG_NAME}/postgres:$SANITIZED_BRANCH ${ORG_NAME}/postgres:aarch64-$SANITIZED_BRANCH --os linux --arch arm64 --variant v8
- docker manifest push --purge ${ORG_NAME}/postgres:$SANITIZED_BRANCH
only:
- develop
- /^release\/.*$/
except:
- schedules
tags:
- aws-autoscale
build-container-dev:
stage: build
script:
- docker build -t ${ORG_NAME}/postgres-private:$(arch)-$SANITIZED_BRANCH .
- docker push ${ORG_NAME}/postgres-private:$(arch)-$SANITIZED_BRANCH
except:
- develop
- /^release\/.*$/
tags:
- ${TAG}
parallel:
matrix:
- TAG: [ aws-autoscale, aws-autoscale-arm64 ]
manifest-container-dev:
stage: manifest
script:
- docker pull ${ORG_NAME}/postgres-private:x86_64-$SANITIZED_BRANCH
- docker pull ${ORG_NAME}/postgres-private:aarch64-$SANITIZED_BRANCH
- "docker manifest push --purge ${ORG_NAME}/postgres-private:$SANITIZED_BRANCH || :"
- docker manifest create ${ORG_NAME}/postgres-private:$SANITIZED_BRANCH ${ORG_NAME}/postgres-private:x86_64-$SANITIZED_BRANCH ${ORG_NAME}/postgres-private:aarch64-$SANITIZED_BRANCH
- docker manifest annotate ${ORG_NAME}/postgres-private:$SANITIZED_BRANCH ${ORG_NAME}/postgres-private:aarch64-$SANITIZED_BRANCH --os linux --arch arm64 --variant v8
- docker manifest push --purge ${ORG_NAME}/postgres-private:$SANITIZED_BRANCH
except:
- develop
- /^release\/.*$/
tags:
- aws-autoscale
build-container-schedules:
stage: build
script:
- docker build -t ${ORG_NAME}/postgres:$(arch)-$SANITIZED_ROLLING_BRANCH .
- docker push ${ORG_NAME}/postgres:$(arch)-$SANITIZED_ROLLING_BRANCH
only:
- schedules
tags:
- ${TAG}
parallel:
matrix:
- TAG: [ aws-autoscale, aws-autoscale-arm64 ]
manifest-container-schedules:
stage: build
script:
- docker pull ${ORG_NAME}/postgres:x86_64-$SANITIZED_ROLLING_BRANCH
- docker pull ${ORG_NAME}/postgres:aarch64-$SANITIZED_ROLLING_BRANCH
- "docker manifest push --purge ${ORG_NAME}/postgres:$SANITIZED_ROLLING_BRANCH || :"
- docker manifest create ${ORG_NAME}/postgres:$SANITIZED_ROLLING_BRANCH ${ORG_NAME}/postgres:x86_64-$SANITIZED_ROLLING_BRANCH ${ORG_NAME}/postgres:aarch64-$SANITIZED_ROLLING_BRANCH
- docker manifest annotate ${ORG_NAME}/postgres:$SANITIZED_ROLLING_BRANCH ${ORG_NAME}/postgres:aarch64-$SANITIZED_ROLLING_BRANCH --os linux --arch arm64 --variant v8
- docker manifest push --purge ${ORG_NAME}/postgres:$SANITIZED_ROLLING_BRANCH
only:
- schedules
tags:
- aws-autoscale