-
Notifications
You must be signed in to change notification settings - Fork 4
37 lines (34 loc) · 1.06 KB
/
test_dockerdb.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
name: Test docker-compose database
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Patch docker-compose.yml
run: sed -i 's,.*/mnt/ssd/postgresql.*,#\\0,' database/docker-compose.yml
- name: Setup certificates
run: |
cd database
echo -e "1\nn" | ./gen_certs.sh
echo -e "2\ncoffeebuddydb" | ./gen_certs.sh
echo -e "3\ncoffeebuddy01\nn" | ./gen_certs.sh
- name: Create container
run: |
cd database
docker compose up
- name: Start container again
run: |
cd database
docker compose up -d
sleep 5
PGSSLMODE=require \
PGSSLROOTCERT=certs/ca/root.crt \
PGSSLCERT=certs/client_coffeebuddy01/postgresql.crt \
PGSSLKEY=certs/client_coffeebuddy01/postgresql.key \
psql -U coffeebuddy01 -h localhost -d coffeebuddy -lqt
- name: Stop containers
if: always()
run: |
cd database
docker compose down