fixed docker login

This commit is contained in:
Philipp Kunz
2016-06-02 17:57:01 +02:00
parent 677f730b34
commit 8dd0f230c0
6 changed files with 30 additions and 4 deletions

View File

@ -5,7 +5,11 @@ import {bash} from "./npmci.bash";
let docker = function(){
let done = plugins.q.defer();
let dockerRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)/
let dockerRegexResultArray = dockerRegex.exec("process.env.NPMCI_LOGIN_DOCKER");
if(!process.env.NPMCI_LOGIN_DOCKER){
plugins.beautylog.error("You have to specify Login Data to the Docker Registry");
process.exit(1);
}
let dockerRegexResultArray = dockerRegex.exec(process.env.NPMCI_LOGIN_DOCKER);
let username = dockerRegexResultArray[1];
let password = dockerRegexResultArray[2];
bash("docker login -u " + username + " -p " + password);