From 2533d1a88ad8eadb516ecfb556da5461ca20c242 Mon Sep 17 00:00:00 2001 From: Timm Murray Date: Wed, 21 Jul 2021 20:12:43 +0000 Subject: [PATCH] Use a hostname to connect to the database, and add that hostname when we start the docker container --- Jenkinsfile | 2 +- start_docker.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 048af36..9ff86c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,7 +32,7 @@ node { conf.postgresql.passwd = RFID_DB_PASSWORD conf.postgresql.username = 'doorbot' conf.postgresql.database = 'doorbot-' + project_uuid - conf.postgresql.host = '10.0.4.164' + conf.postgresql.host = 'database' conf.postgresql.port = 5432 conf.build_id = env.BUILD_ID conf.build_branch = env.BRANCH_NAME diff --git a/start_docker.sh b/start_docker.sh index e96eee5..9ec7f56 100755 --- a/start_docker.sh +++ b/start_docker.sh @@ -17,4 +17,5 @@ echo "Starting ${NAME}" docker run \ -p 5000:5000 \ -d --name=${CONTAINER_NAME} \ + --add-host=database:10.0.4.164 \ docker.shop.thebodgery.org/${NAME}