-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
109 lines (100 loc) · 4.23 KB
/
.gitlab-ci.yml
File metadata and controls
109 lines (100 loc) · 4.23 KB
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
image: docker:28.2.2
services:
- docker:28.2.2-dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_AUTH_CONFIG: ${_DOCKER_AUTH_CONFIG}
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:
- openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout db_server.key -out db_server.crt -subj "/C=US/ST=VA/L=None/O=None/OU=DoFu/CN=$(hostname)/emailAddress=none@none.none"
- 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: [ oci-fixed-amd, oci-fixed-arm ]
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:
- oci-fixed-amd
build-container-dev:
stage: build
script:
- openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout db_server.key -out db_server.crt -subj "/C=US/ST=VA/L=None/O=None/OU=DoFu/CN=$(hostname)/emailAddress=none@none.none"
- 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: [ oci-fixed-amd, oci-fixed-arm ]
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:
- oci-fixed-amd
build-container-schedules:
stage: build
script:
- openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout db_server.key -out db_server.crt -subj "/C=US/ST=VA/L=None/O=None/OU=DoFu/CN=$(hostname)/emailAddress=none@none.none"
- 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: [ oci-fixed-amd, oci-fixed-arm ]
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:
- oci-fixed-amd