move docker files to root

This commit is contained in:
fpellet 2020-01-19 19:56:22 +01:00
parent 5c7636e4c7
commit c619c0235d
8 changed files with 20 additions and 10 deletions

View File

@ -1,4 +1,4 @@
FROM postgres:12.1 FROM postgres:12.1 as base
WORKDIR /app WORKDIR /app
ENV PGHOST=localhost ENV PGHOST=localhost
@ -15,6 +15,9 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
ADD ./*.sh /app/ ADD ./*.sh /app/
ADD ./*.sql /app/ ADD ./src /app/src
ADD ./pgunit/initialize.sh /app/
ADD ./pgunit/*.sql /app/
RUN chmod +x ./*.sh \ RUN chmod +x ./*.sh \
&& ./initializeDocker.sh && ./initializeDocker.sh

View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -ex
echo "Create database"
psql -d postgres -c 'DROP DATABASE IF EXISTS kata;'
psql -d postgres -c 'CREATE DATABASE kata;'
./initialize.sh
echo "Add current code"
psql -d kata -f src/item.sql
psql -d kata -f src/new_item.sql
psql -d kata -f src/update_quality.sql

View File

@ -2,9 +2,7 @@
set -ex set -ex
echo "Create database" echo "Enable DBLINK"
psql -d postgres -c 'DROP DATABASE IF EXISTS kata;'
psql -d postgres -c 'CREATE DATABASE kata;'
psql -d kata -c 'CREATE EXTENSION DBLINK;' psql -d kata -c 'CREATE EXTENSION DBLINK;'
echo "Initialize test framework" echo "Initialize test framework"
@ -14,8 +12,3 @@ wget https://raw.githubusercontent.com/adrianandrei-ca/pgunit/bc69dfc526ec3db55f
echo "Initialize custom asserts" echo "Initialize custom asserts"
psql -d kata -f asserts.sql psql -d kata -f asserts.sql
echo "Add current code"
psql -d kata -f item.sql
psql -d kata -f new_item.sql
psql -d kata -f update_quality.sql