Skip to content

Commit

Permalink
feat(deploy): docker build arg (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
o-cappasity authored and AVVS committed Oct 16, 2019
1 parent b320677 commit 7245cc9
Show file tree
Hide file tree
Showing 4 changed files with 310 additions and 206 deletions.
4 changes: 4 additions & 0 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ require('yargs')
default: parentProject.name
.replace(/^@[^/]+\//, ''),
})
.option('docker_build_args', {
alias: 'dba',
describe: 'docker build args',
})
.option('repository', {
alias: 'repo',
describe: 'docker repository to use',
Expand Down
16 changes: 15 additions & 1 deletion bin/cmds/docker_cmds/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,22 @@ exports.handler = (argv) => {
exit(1);
}

const args = [
'docket build',
'--squash',
`-t ${mainTag}`,
`-f ${tmpDockerfile}`,
];

const { docker_build_args: dba } = argv;
if (dba && typeof dba === 'object') {
for (const [prop, value] of Object.entries(dba)) {
args.push(`--build-arg ${prop}=${value}`);
}
}

// start builder
const command = `docker build --squash -t ${mainTag} -f ${tmpDockerfile} .`;
const command = `${args.join(' ')} .`;
echo(command);
const build = exec(command);

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"node": ">= 10.5.0"
},
"devDependencies": {
"@babel/cli": "^7.6.2",
"@babel/core": "^7.6.2",
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-transform-strict-mode": "^7.2.0",
"codecov": "^3.6.1",
Expand All @@ -36,13 +36,13 @@
},
"dependencies": {
"@commitlint/cli": "^8.2.0",
"bluebird": "^3.7.0",
"bluebird": "^3.7.1",
"chrome-launcher": "^0.11.2",
"chrome-remote-interface": "^0.28.0",
"death": "^1.1.0",
"find-up": "^4.1.0",
"glob": "^7.1.4",
"husky": "^3.0.8",
"husky": "^3.0.9",
"hyperid": "^2.0.1",
"is": "^3.2.1",
"js-yaml": "^3.13.1",
Expand All @@ -51,12 +51,12 @@
"lodash.set": "^4.3.2",
"ms-conf": "^5.0.2",
"npm-path": "^2.0.4",
"pino": "^5.13.4",
"pino": "^5.13.5",
"read-pkg": "^5.2.0",
"rimraf": "^3.0.0",
"semantic-release": "15.13.24",
"shelljs": "^0.8.3",
"yargs": "^14.0.0"
"yargs": "^14.2.0"
},
"bin": {
"mdep": "./bin/cli.js"
Expand Down
Loading

0 comments on commit 7245cc9

Please sign in to comment.