-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
46 lines (40 loc) · 1.4 KB
/
.travis.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
sudo: required
matrix:
include:
- env: PG_VERSION=9
- env: PG_VERSION=10
- env: PG_VERSION=11
- env: PG_VERSION=12
- env: PG_VERSION=13
- env: PG_VERSION=14
- env: PG_VERSION=15
services:
- docker
before_install:
- docker build --build-arg PG_VERSION=${PG_VERSION} -t image .
install:
- docker run --name TEST -e POSTGRES_PASSWORD=p455w0rd -d image
# wait for the database to come up
- until docker exec TEST psql -U postgres -l; do echo "Waiting for postgres to start..."; sleep 0.5; done
script:
- docker exec TEST psql -U postgres -c "CREATE EXTENSION uint" && echo "SUCCESS"
- >-
docker exec TEST psql -U postgres -c "CREATE TABLE IF NOT EXISTS test (
col1 uint1, col2 uint2, col4 uint4);
INSERT INTO test(col1, col2, col4)
SELECT v % 127, v % 16256, v
FROM generate_series(1, 100000, 42) AS d(v);
WITH t AS (SELECT DISTINCT col1 FROM test) SELECT count(*) FROM t;" && echo "SUCCESS"
- docker logs TEST
after_success:
- docker login -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD
- docker tag image $DOCKER_HUB_USER_ID/postgres-uint:v$PG_VERSION
- docker push $DOCKER_HUB_USER_ID/postgres-uint:v$PG_VERSION
- >
if [ $PG_VERSION == 11 ] ; then
docker tag image $DOCKER_HUB_USER_ID/postgres-uint:latest
docker push $DOCKER_HUB_USER_ID/postgres-uint:latest
fi
after_script:
- docker stop TEST
- docker rm -f TEST