-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more test docker cleanup. ver bump to 0.1.0
- Loading branch information
Showing
4 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
FROM postgres:11 | ||
RUN apt-get update && apt-get install -y make git postgresql-server-dev-11 postgresql-11-pgtap | ||
RUN git clone https://github.com/michelp/pgjwt.git | ||
RUN mkdir "/pgjwt" | ||
WORKDIR "/pgjwt" | ||
COPY . . | ||
RUN make && make install | ||
COPY test.sql test.sql | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
EXTENSION = pgjwt | ||
DATA = pgjwt--0.0.1.sql | ||
DATA = pgjwt--0.1.0.sql | ||
|
||
# postgres build stuff | ||
PG_CONFIG = pg_config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DB_HOST="pgjwt-test-db" | ||
DB_NAME="postgres" | ||
|
||
POSTGRES_SU="postgres" | ||
|
||
SU="postgres" | ||
EXEC="docker exec $DB_HOST" | ||
|
||
echo destroying any previous test container | ||
docker rm --force "$DB_HOST" | ||
|
||
echo building test image | ||
docker build test --force-rm -t pgjwt/test | ||
docker build . --force-rm -t pgjwt/test | ||
|
||
echo running test container | ||
docker run -d --name "$DB_HOST" pgjwt/test | ||
|
||
echo waiting for database to accept connections | ||
until | ||
$EXEC \ | ||
psql -o /dev/null -t -q -U "$POSTGRES_SU" \ | ||
psql -o /dev/null -t -q -U "$SU" \ | ||
-c 'select pg_sleep(1)' \ | ||
2>/dev/null; | ||
do sleep 1; | ||
done | ||
|
||
echo running tests | ||
$EXEC pg_prove -U "$POSTGRES_SU" /pgjwt/test.sql | ||
$EXEC pg_prove -U "$SU" /pgjwt/test.sql | ||
|
||
echo destroying test container and image | ||
docker rm --force "$DB_HOST" | ||
docker rmi pgjwt/test |
File renamed without changes.