You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The true in the runIf function call below makes the plugin check for login every time, regardless if I want to push a container or not. This should be changed to opts.push so that it's only running if I decide I want to push. It also removes the requirement for the username and pushLocation to be present if push is set to false.
runIf(true, function(){
var loginOpts = ['login']
if(opts.pushLocation !== DOCKER_HUB_URL) {
loginOpts.push(opts.pushLocation)
}
var dockerLogin = spawn('docker', loginOpts)
dockerLogin.stdout.on('data', function(data){
data = data || ''
var usernameRegex = /\(.*\)/
if(usernameRegex.exec(data) && usernameRegex.exec(data).length > 0) {
if(usernameRegex.exec(data)[0] !== '(' + opts.username + ')'){
grunt.fatal('Please Login First')
}
next()
} else {
grunt.fatal('Please login to the docker registry - ' + opts.pushLocation)
}
})
})
The text was updated successfully, but these errors were encountered:
The true in the runIf function call below makes the plugin check for login every time, regardless if I want to push a container or not. This should be changed to opts.push so that it's only running if I decide I want to push. It also removes the requirement for the username and pushLocation to be present if push is set to false.
The text was updated successfully, but these errors were encountered: