8000 Merge branch 'tests' into 'master' · postgres-ai/custom-images@ba46fb8 · GitHub
[go: up one dir, main page]

Skip to content

Commit ba46fb8

Browse files
committed
Merge branch 'tests' into 'master'
Fix bg_mon and add tests for extensions See merge request postgres-ai/custom-images!68
2 parents 3261680 + 8357ae0 commit ba46fb8

File tree

4 files changed

+396
-7
lines changed

4 files changed

+396
-7
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
stages:
22
- build-image
3+
- test-image
34

45
include:
56
- local: '/extended-postgres/build-images-ci.yml'
7+
- local: '/extended-postgres/test-images-ci.yml'
68
- local: '/migration-tools/build-images-migration-tools.yml'

extended-postgres/Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,17 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
114114
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-show-plans; \
115115
fi \
116116
# pg_cron extension
117-
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \
118-
cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \
119-
&& cd pg_cron \
120-
&& make && make install; \
121-
else \
122-
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \
117+
# for PostgreSQL 10-15, install from source (https://gitlab.com/postgres-ai/custom-images/-/merge_requests/56)
118+
&& if [ $(echo "$PG_SERVER_VERSION >= 10" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \
119+
cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \
120+
&& cd pg_cron \
121+
&& make && make install; \
122+
elif [ $(echo "$PG_SERVER_VERSION == 9.6" | /usr/bin/bc) = "1" ]; then \
123+
cd /tmp && git clone --branch v1.3.1 --single-branch https://github.com/citusdata/pg_cron.git \
124+
&& cd pg_cron \
125+
&& make && make install; \
126+
elif [ $(echo "$PG_SERVER_VERSION >= 16" | /usr/bin/bc) = "1" ]; then \
127+
apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \
123128
fi \
124129
# postgresql_anonymizer extension
125130
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
@@ -187,7 +192,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
187192
gcc make wget unzip curl libc6-dev apt-transport-https git \
188193
postgresql-server-dev-${PG_SERVER_VERSION} pgxnclient build-essential \
189194
libssl-dev krb5-multidev comerr-dev krb5-multidev libkrb5-dev apt-utils lsb-release \
190-
libgssrpc4 libevent-dev libbrotli-dev \
195+
libgssrpc4 \
191196
&& apt-get clean -y autoclean \
192197
&& rm -rf /var/lib/apt/lists/* \
193198
# remove standard pgdata

extended-postgres/test-images-ci.yml

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
stages:
2+
- test-image
3+
4+
.job_template: &test_image_definition
5+
image: docker:19
6+
stage: test-image
7+
services:
8+
- alias: docker
9+
name: docker:19.03.5-dind
10+
script:
11+
- apk add --no-cache bash
12+
- chmod +x extended-postgres/test/images_test.sh
13+
- TAG=${TAG} PG_IMAGE_NAME="${DOCKER_NAME}" PG_SERVER_VERSION=${PG_SERVER_VERSION} CREATE_EXTENSION_EXCLUDE=${CREATE_EXTENSION_EXCLUDE} bash extended-postgres/test/images_test.sh
14+
15+
.only_tag_template: &only_release
16+
rules:
17+
- if: $CI_COMMIT_TAG =~ /^[0-9.]+$/ || $COMMIT_TAG =~ /^[0-9.]+$/
18+
when: always
19+
20+
.release_vars:
21+
variables: &release_vars
22+
TAG: $CI_COMMIT_TAG
23+
DOCKER_NAME: "postgresai/extended-postgres"
24+
25+
.only_branch_template: &only_branch
26+
rules:
27+
- if: $CI_COMMIT_TAG =~ /^[0-9.]+$/ || $COMMIT_TAG =~ /^[0-9.]+$/
28+
when: never
29+
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_SLUG != "master"
30+
when: manual
31+
32+
.branch_vars:
33+
variables: &branch_vars
34+
TAG: $CI_COMMIT_REF_SLUG
35+
DOCKER_NAME: "${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/extended-postgres"
36+
37+
test-extended-postgres-9-6-image-latest:
38+
<<: *test_image_definition
39+
<<: *only_release
40+
dependencies:
41+
- build-extended-postgres-9-6-image-latest
42+
variables:
43+
<<: *release_vars
44+
PG_SERVER_VERSION: "9.6"
45+
CREATE_EXTENSION_EXCLUDE: "pg_cron"
46+
47+
test-extended-postgres-10-image-latest:
48+
<<: *test_image_definition
49+
<<: *only_release
50+
dependencies:
51+
- build-extended-postgres-10-image-latest
52+
variables:
53+
<<: *release_vars
54+
PG_SERVER_VERSION: "10"
55+
56+
test-extended-postgres-11-image-latest:
57+
<<: *test_image_definition
58+
<<: *only_release
59+
dependencies:
60+
- build-extended-postgres-11-image-latest
61+
variables:
62+
<<: *release_vars
63+
PG_SERVER_VERSION: "11"
64+
65+
test-extended-postgres-12-image-latest:
66+
<<: *test_image_definition
67+
<<: *only_release
68+
dependencies:
69+
- build-extended-postgres-12-image-latest
70+
variables:
71+
<<: *release_vars
72+
PG_SERVER_VERSION: "12"
73+
74+
test-extended-postgres-13-image-latest:
75+
<<: *test_image_definition
76+
<<: *only_release
77+
dependencies:
78+
- build-extended-postgres-13-image-latest
79+
variables:
80+
<<: *release_vars
81+
PG_SERVER_VERSION: "13"
82+
83+
test-extended-postgres-14-image-latest:
84+
<<: *test_image_definition
85+
<<: *only_release
86+
dependencies:
87+
- build-extended-postgres-14-image-latest
88+
variables:
89+
<<: *release_vars
90+
PG_SERVER_VERSION: "14"
91+
92+
test-extended-postgres-15-image-latest:
93+
<<: *test_image_definition
94+
<<: *only_release
95+
dependencies:
96+
- build-extended-postgres-15-image-latest
97+
variables:
98+
<<: *release_vars
99+
PG_SERVER_VERSION: "15"
100+
101+
test-extended-postgres-16-image-latest:
102+
<<: *test_image_definition
103+
<<: *only_release
104+
dependencies:
105+
- build-extended-postgres-16-image-latest
106+
variables:
107+
<<: *release_vars
108+
PG_SERVER_VERSION: "16"
109+
110+
test-extended-postgres-17-image-latest:
111+
<<: *test_image_definition
112+
<<: *only_release
113+
dependencies:
114+
- build-extended-postgres-17-image-latest
115+
variables:
116+
<<: *release_vars
117+
PG_SERVER_VERSION: "17"
118+
119+
120+
test-extended-postgres-9-6-image-feature:
121+
<<: *test_image_definition
122+
<<: *only_branch
123+
dependencies:
124+
- build-extended-postgres-9-6-image-feature
125+
variables:
126+
<<: *branch_vars
127+
PG_SERVER_VERSION: "9.6"
128+
CREATE_EXTENSION_EXCLUDE: "pg_cron"
129+
130+
test-extended-postgres-10-image-feature:
131+
<<: *test_image_definition
132+
<<: *only_branch
133+
dependencies:
134+
- build-extended-postgres-10-image-feature
135+
variables:
136+
<<: *branch_vars
137+
PG_SERVER_VERSION: "10"
138+
139+
test-extended-postgres-11-image-feature:
140+
<<: *test_image_definition
141+
<<: *only_branch
142+
dependencies:
143+
- build-extended-postgres-11-image-feature
144+
variables:
145+
<<: *branch_vars
146+
PG_SERVER_VERSION: "11"
147+
148+
test-extended-postgres-12-image-feature:
149+
<<: *test_image_definition
150+
<<: *only_branch
151+
dependencies:
152+
- build-extended-postgres-12-image-feature
153+
variables:
154+
<<: *branch_vars
155+
PG_SERVER_VERSION: "12"
156+
157+
test-extended-postgres-13-image-feature:
158+
<<: *test_image_definition
159+
<<: *only_branch
160+
dependencies:
161+
- build-extended-postgres-13-image-feature
162+
variables:
163+
<<: *branch_vars
164+
PG_SERVER_VERSION: "13"
165+
166+
test-extended-postgres-14-image-feature:
167+
<<: *test_image_definition
168+
<<: *only_branch
169+
dependencies:
170+
- build-extended-postgres-14-image-feature
171+
variables:
172+
<<: *branch_vars
173+
PG_SERVER_VERSION: "14"
174+
175+
test-extended-postgres-15-image-feature:
176+
<<: *test_image_definition
177+
<<: *only_branch
178+
dependencies:
179+
- build-extended-postgres-15-image-feature
180+
variables:
181+
<<: *branch_vars
182+
PG_SERVER_VERSION: "15"
183+
184+
test-extended-postgres-16-image-feature:
185+
<<: *test_image_definition
186+
<<: *only_branch
187+
dependencies:
188+
- build-extended-postgres-16-image-feature
189+
variables:
190+
<<: *branch_vars
191+
PG_SERVER_VERSION: "16"
192+
193+
test-extended-postgres-17-image-feature:
194+
<<: *test_image_definition
195+
<<: *only_branch
196+
dependencies:
197+
- build-extended-postgres-17-image-feature
198+
variables:
199+
<<: *branch_vars
200+
PG_SERVER_VERSION: "17"

0 commit comments

Comments
 (0)
0