deis / postgres

A PostgreSQL database used by Deis Workflow.
https://deis.com
MIT License
36 stars 21 forks source link

ref(postgres): move username and password to secrets #35

Closed kmala closed 8 years ago

kmala commented 8 years ago

closes #18

bacongobbler commented 8 years ago

looks like from the tests the container isn't running: https://travis-ci.org/deis/postgres/builds/108866748

bacongobbler commented 8 years ago

Hmm, I understand now. It's because in the tests we don't have /etc/secret-volume/user available in the container. I'll see if I can come up with a fix.

bacongobbler commented 8 years ago

@kmala I found that this works with the following patch:

diff --git a/contrib/ci/test.sh b/contrib/ci/test.sh
index 5e25a24..1a54565 100755
--- a/contrib/ci/test.sh
+++ b/contrib/ci/test.sh
@@ -3,7 +3,13 @@
 set -eof pipefail
 set -x

-JOB=$(docker run -d $1)
+# make sure we are here
+CURRENT_DIR=$(cd $(dirname $0); pwd)
+
+mkdir -p tmp
+echo "testuser" > tmp/user
+echo "icanttellyou" > tmp/pass
+JOB=$(docker run -dv $CURRENT_DIR/tmp:/etc/secret-volume $1)
 # wait for postgres to boot
 sleep 10
 docker exec $JOB is_master

also need to create .gitignore with contrib/ci/tmp in there and this should pass CI.

bacongobbler commented 8 years ago

You'll also want to merge the two commits into one. Thanks! :)

bacongobbler commented 8 years ago

I'm going to close this, but your work lives on in #36. Thanks!