update login

This commit is contained in:
Philipp Kunz 2017-08-26 09:40:40 +02:00
parent 3e1397e13f
commit 24dd9edcae
3 changed files with 8 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@ -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}`)
}
await bash(`docker tag ${this.buildTag} ${this.gitlabReleaseTag}`)
await bash(`docker push ${this.gitlabReleaseTag}`)
break
case 'test':
default:

View File

@ -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}`)
}