mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-11 20:02:09 +00:00
move docker files to root
This commit is contained in:
parent
5c7636e4c7
commit
c619c0235d
@ -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
|
||||||
14
plpgsql/initializeDatabase.sh
Normal file
14
plpgsql/initializeDatabase.sh
Normal 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
|
||||||
@ -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
|
|
||||||
Loading…
Reference in New Issue
Block a user