update login
This commit is contained in:
parent
3e1397e13f
commit
24dd9edcae
5
dist/mod_docker/mod.builddocker.js
vendored
5
dist/mod_docker/mod.builddocker.js
vendored
File diff suppressed because one or more lines are too long
@ -197,12 +197,8 @@ export class Dockerfile {
|
||||
case 'release':
|
||||
await bash(`docker tag ${this.buildTag} ${this.releaseTag}`)
|
||||
await bash(`docker push ${this.releaseTag}`)
|
||||
|
||||
// if release registry is different from gitlab
|
||||
if (NpmciEnv.dockerRegistry !== 'registry.gitlab.com') {
|
||||
await bash(`docker tag ${this.buildTag} ${this.gitlabReleaseTag}`)
|
||||
await bash(`docker push ${this.gitlabReleaseTag}`)
|
||||
}
|
||||
break
|
||||
case 'test':
|
||||
default:
|
||||
|
@ -35,7 +35,7 @@ let docker = async () => {
|
||||
|
||||
// handle registries
|
||||
plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_LOGIN_DOCKER*', async (envString) => {
|
||||
let dockerRegexResultArray = process.env.NPMCI_LOGIN_DOCKER.split('|')
|
||||
let dockerRegexResultArray = envString.split('|')
|
||||
if (dockerRegexResultArray.length !== 3) {
|
||||
plugins.beautylog.error('malformed docker env var...')
|
||||
process.exit(1)
|
||||
@ -45,7 +45,8 @@ let docker = async () => {
|
||||
let username = dockerRegexResultArray[1]
|
||||
let password = dockerRegexResultArray[2]
|
||||
if (registry === 'docker.io') {
|
||||
await bash('docker login -u ' + username + ' -p ' + password)
|
||||
await bash(`docker login -u ${username} -p ${password}`)
|
||||
plugins.beautylog.info('Logged in to standard docker hub')
|
||||
} else {
|
||||
await bash(`docker login -u ${username} -p ${password} ${registry}`)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user