From 1cafbdab6ec8af0d8e57c3b20feaab63002367c5 Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 5 Oct 2022 12:26:42 +0200 Subject: [PATCH] Connect to docker network --- db/docker.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/db/docker.js b/db/docker.js index a844c13f2..3bf05cc9b 100644 --- a/db/docker.js +++ b/db/docker.js @@ -57,17 +57,12 @@ module.exports = class Docker { let netSettings = JSON.parse(inspect.stdout); if (ci) { - console.log('Running on CI...'); - // this.dbConf.host = netSettings.Gateway; this.dbConf.host = netSettings.Networks.jenkins.IPAddress; - } + this.dbConf.port = 3306; - // console.log(netSettings); - - // this.dbConf.port = netSettings.Ports['3306/tcp'][0]['HostPort']; - this.dbConf.port = 3306; - console.log('Host: ', this.dbConf.host); - console.log('Port: ', this.dbConf.port); + await this.execP(`docker network connect jenkins ${this.id}`); + } else + this.dbConf.port = netSettings.Ports['3306/tcp'][0]['HostPort']; } await this.wait();