File tree 4 files changed +29
-2
lines changed
4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 1
1
__pycache__
2
2
.happy
3
3
.coverage
4
+ .env
4
5
db.sqlite3
5
6
ci.db
6
7
server.log
Original file line number Diff line number Diff line change 15
15
key : coverage-{{ .Revision }}
16
16
paths :
17
17
- .coverage
18
+ integration :
19
+ docker :
20
+ - image : nibbleproject/nibble-ci
21
+ steps :
22
+ - checkout
23
+ - setup_remote_docker
24
+ - run :
25
+ name : Install requirements
26
+ command : sudo pipenv install --system --dev
27
+ - run :
28
+ name : Run integration tests
29
+ command : |
30
+ set -x
31
+ docker-compose up -d
32
+ docker-compose stop
18
33
coverage :
19
34
docker :
20
35
- image : nibbleproject/nibble-ci
@@ -75,6 +90,7 @@ workflows:
75
90
master :
76
91
jobs :
77
92
- test
93
+ - integration
78
94
- coverage :
79
95
requires :
80
96
- test
@@ -84,6 +100,7 @@ workflows:
84
100
- deploy_staging :
85
101
requires :
86
102
- test
103
+ - integration
87
104
filters :
88
105
branches :
89
106
only : master
Original file line number Diff line number Diff line change 1
1
web :
2
2
build : .
3
3
environment :
4
+ - DATABASE_USER
4
5
- DATABASE_PASSWORD
5
6
links :
6
7
- postgres
7
8
ports :
8
9
- " 5000:5000"
9
10
postgres :
10
11
image : postgres
12
+ environment :
13
+ - POSTGRES_USER=test
14
+ - POSTGRES_PASSWORD=test
Original file line number Diff line number Diff line change @@ -4,12 +4,17 @@ if [ "$1" = 'start' ];
4
4
then
5
5
if [ -n " $DATABASE_URL " ]; then
6
6
7
- echo " There's a database url already...??? "
7
+ echo " Found a database URL, skipping setup. "
8
8
9
9
elif [ -n " $POSTGRES_PORT_5432_TCP_ADDR " ]; then
10
10
11
11
echo ' We got postgres!!!!'
12
12
13
+ if [ -z " $DATABASE_USER " ]; then
14
+ echo ' No application database user defined. Stopping.'
15
+ exit 1
16
+ fi
17
+
13
18
if [ -z " $DATABASE_PASSWORD " ]; then
14
19
echo ' No application database password defined. Stopping.'
15
20
exit 1
63
68
export DATABASE_URL=" postgres://$DATABASE_USER :$DATABASE_PASSWORD @$POSTGRES_PORT_5432_TCP_ADDR :$POSTGRES_PORT_5432_TCP_PORT /$DATABASE_NAME "
64
69
65
70
else
66
- echo ' No database ¯\_(ツ)_/¯'
71
+ echo ' No database defined, stopping. ¯\_(ツ)_/¯'
67
72
exit 1
68
73
fi
69
74
You can’t perform that action at this time.
0 commit comments