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': case 'release':
await bash(`docker tag ${this.buildTag} ${this.releaseTag}`) await bash(`docker tag ${this.buildTag} ${this.releaseTag}`)
await bash(`docker push ${this.releaseTag}`) await bash(`docker push ${this.releaseTag}`)
await bash(`docker tag ${this.buildTag} ${this.gitlabReleaseTag}`)
// if release registry is different from gitlab await bash(`docker push ${this.gitlabReleaseTag}`)
if (NpmciEnv.dockerRegistry !== 'registry.gitlab.com') {
await bash(`docker tag ${this.buildTag} ${this.gitlabReleaseTag}`)
await bash(`docker push ${this.gitlabReleaseTag}`)
}
break break
case 'test': case 'test':
default: default:

View File

@ -35,7 +35,7 @@ let docker = async () => {
// handle registries // handle registries
plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_LOGIN_DOCKER*', async (envString) => { 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) { if (dockerRegexResultArray.length !== 3) {
plugins.beautylog.error('malformed docker env var...') plugins.beautylog.error('malformed docker env var...')
process.exit(1) process.exit(1)
@ -45,7 +45,8 @@ let docker = async () => {
let username = dockerRegexResultArray[1] let username = dockerRegexResultArray[1]
let password = dockerRegexResultArray[2] let password = dockerRegexResultArray[2]
if (registry === 'docker.io') { 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 { } else {
await bash(`docker login -u ${username} -p ${password} ${registry}`) await bash(`docker login -u ${username} -p ${password} ${registry}`)
} }