attach to network
gitea/salix/pipeline/head Something is wrong with the build of this commit
Details
gitea/salix/pipeline/head Something is wrong with the build of this commit
Details
This commit is contained in:
parent
1cafbdab6e
commit
627f0d762e
|
@ -45,7 +45,6 @@ module.exports = class Docker {
|
|||
log('Starting container...');
|
||||
const container = await this.execP(`
|
||||
docker run \
|
||||
--network="jenkins" \
|
||||
--env RUN_CHOWN=${runChown} \
|
||||
-d ${dockerArgs} salix-db
|
||||
`);
|
||||
|
@ -53,14 +52,15 @@ module.exports = class Docker {
|
|||
|
||||
try {
|
||||
if (this.isRandom) {
|
||||
if (ci)
|
||||
await this.execP(`docker network connect jenkins ${this.id}`);
|
||||
|
||||
let inspect = await this.execP(`docker inspect -f "{{json .NetworkSettings}}" ${this.id}`);
|
||||
let netSettings = JSON.parse(inspect.stdout);
|
||||
|
||||
if (ci) {
|
||||
this.dbConf.host = netSettings.Networks.jenkins.IPAddress;
|
||||
this.dbConf.port = 3306;
|
||||
|
||||
await this.execP(`docker network connect jenkins ${this.id}`);
|
||||
} else
|
||||
this.dbConf.port = netSettings.Ports['3306/tcp'][0]['HostPort'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue