protected openRegistryEndpoint(authenticationToken?: AuthenticationToken): void {
     
     if (authenticationToken) {     
         this.registryAuth = {};
  
         this.registryAuth["username"] = authenticationToken.getUsername();
         this.registryAuth["password"] = authenticationToken.getPassword();
         this.registryAuth["registry"] = authenticationToken.getLoginServerUrl();
         
         var command = this.createCommand();
         if (this.registryAuth) {
             command.arg("login");
             command.arg(["-u", this.registryAuth["username"]]);
             command.arg(["-p", this.registryAuth["password"]]);
             command.arg(this.registryAuth["registry"]);
             command.execSync();
             this.registryHost = this.registryAuth["registry"];
         }
     }
 }
Ejemplo n.º 2
0
let getDockerRegistrySecretArgs = () => {
    let authProvider: AuthenticationToken = getDockerRegistryEndpointAuthenticationToken(TaskInputParameters.dockerRegistryEndpoint);
    return `docker-registry ${TaskInputParameters.secretName.trim()} --docker-username=${authProvider.getUsername()} --docker-password=${authProvider.getPassword()} --docker-server=${authProvider.getLoginServerUrl()} --docker-email=${authProvider.getEmail()}`;
}