Skip to content

Commit

Permalink
Support for docker registries other than docker hub.
Browse files Browse the repository at this point in the history
  • Loading branch information
muratgozel committed Sep 23, 2021
1 parent a59ceaf commit 98ba9f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 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.1.5",
"version": "0.2.0",
"description": "Automated semantic and calendar versioning tool with plugin support.",
"main": "src/index.js",
"bin": {
Expand Down
7 changes: 7 additions & 0 deletions src/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ module.exports = {
env: 'RELEASER_DOCKER_REPO',
arg: 'docker-repo'
},
registry: {
doc: 'Container registry host. ghcr.io for example. Default is Docker Hub.',
format: String,
default: '',
env: 'RELEASER_DOCKER_REGISTRY',
arg: 'docker-registry'
},
build: {
path: {
doc: 'Docker build context.',
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function docker() {

console.log(colors.blue('Publishing docker image on docker hub...'))

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

0 comments on commit 98ba9f4

Please sign in to comment.