diff --git a/clr_test/db-updater/Dockerfile b/clr_test/db-updater/Dockerfile index c13d6eb87..d1b0cc799 100644 --- a/clr_test/db-updater/Dockerfile +++ b/clr_test/db-updater/Dockerfile @@ -1,7 +1,10 @@ FROM alpine ADD combined_update_ddl.sql /init.sql +ADD init.sh /init.sh RUN apk add --update --no-cache postgresql-client +RUN chmod +x init.sql +RUN find . -name "*.sh" | xargs sed -i 's/\r$//' -CMD [ "sh", "-c", "ls -la && psql --version && psql -U clearing -h db -p 5432 -d clearing -f ./init.sql && tail -f /dev/null" ] \ No newline at end of file +CMD [ "sh", "-c", "./init.sh" ] \ No newline at end of file diff --git a/clr_test/db-updater/init.sh b/clr_test/db-updater/init.sh new file mode 100644 index 000000000..44561ca77 --- /dev/null +++ b/clr_test/db-updater/init.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +echo "PSQL version: " && psql --version + +cat init.sql + +echo "Updating database" && psql -h db clearing < init.sql clearing + +tail -f /dev/null \ No newline at end of file