Skip to content

Commit

Permalink
Added host option to build command.
Browse files Browse the repository at this point in the history
  • Loading branch information
muratgozel committed Sep 23, 2021
1 parent 98ba9f4 commit 13b6f81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-releaser",
"version": "0.2.0",
"version": "0.2.1",
"description": "Automated semantic and calendar versioning tool with plugin support.",
"main": "src/index.js",
"bin": {
Expand Down
9 changes: 7 additions & 2 deletions src/plugins/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ function docker() {

console.log(colors.blue('Building docker image with "latest" and "' + nextTag + '" tags...'))

const connstr = this.config.get('docker.user') + '/' + this.config.get('docker.repo')
const host = this.config.get('docker.registry')
const user = this.config.get('docker.user')
const repo = this.config.get('docker.repo')
const connstr = (host.length > 0 ? host + '/' : '') + user + '/' + repo
const cmd = `docker build -t ${connstr}:latest -t ${connstr}:${nextTag} ${this.config.get('docker.build.path')}`
execSync(cmd, {stdio: 'inherit', encoding: 'utf8'})
}
Expand All @@ -21,7 +24,9 @@ function docker() {
console.log(colors.blue('Publishing docker image on docker hub...'))

const host = this.config.get('docker.registry')
const connstr = (host.length > 0 ? host + '/' : '') + this.config.get('docker.user') + '/' + this.config.get('docker.repo')
const user = this.config.get('docker.user')
const repo = this.config.get('docker.repo')
const connstr = (host.length > 0 ? host + '/' : '') + user + '/' + repo
const cmd = `docker push ${connstr} --all-tags`
execSync(cmd, {stdio: 'inherit', encoding: 'utf8'})
}
Expand Down

0 comments on commit 13b6f81

Please sign in to comment.