DB IP autodetected when random container
gitea/salix/dev Something is wrong with the build of this commit
Details
gitea/salix/dev Something is wrong with the build of this commit
Details
This commit is contained in:
parent
3d88d41bd0
commit
b2eab3ab51
|
@ -68,7 +68,6 @@ pipeline {
|
||||||
environment {
|
environment {
|
||||||
NODE_ENV = ""
|
NODE_ENV = ""
|
||||||
FIREFOX_BIN = "/opt/firefox/firefox-bin"
|
FIREFOX_BIN = "/opt/firefox/firefox-bin"
|
||||||
DB_HOST = "${env.DOCKER_HOST_2}"
|
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
nodejs('node-lts') {
|
nodejs('node-lts') {
|
||||||
|
|
|
@ -23,9 +23,6 @@ let containerId = 'salix-db';
|
||||||
let dataSources = require('./loopback/server/datasources.json');
|
let dataSources = require('./loopback/server/datasources.json');
|
||||||
let dbConf = dataSources.vn;
|
let dbConf = dataSources.vn;
|
||||||
|
|
||||||
if (process.env.DB_HOST)
|
|
||||||
dbConf.host = process.env.DB_HOST;
|
|
||||||
|
|
||||||
let backSources = [
|
let backSources = [
|
||||||
'!node_modules',
|
'!node_modules',
|
||||||
'loopback',
|
'loopback',
|
||||||
|
@ -424,8 +421,10 @@ async function docker() {
|
||||||
|
|
||||||
if (argv['random']) {
|
if (argv['random']) {
|
||||||
let inspect = await execP(`docker inspect -f "{{json .NetworkSettings.Ports}}" ${containerId}`);
|
let inspect = await execP(`docker inspect -f "{{json .NetworkSettings.Ports}}" ${containerId}`);
|
||||||
let ports = JSON.parse(inspect.stdout);
|
let netSettings = JSON.parse(inspect);
|
||||||
dbConf.port = ports['3306/tcp'][0]['HostPort'];
|
|
||||||
|
dbConf.host = netSettings.IPAddress;
|
||||||
|
dbConf.port = netSettings.Ports['3306/tcp'][0]['HostPort'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runChown) await dockerWait();
|
if (runChown) await dockerWait();
|
||||||
|
|
Loading…
Reference in New Issue