当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript registryauthenticationtoken.getDockerRegistryEndpointAuthenticationToken函数代码示例

本文整理汇总了TypeScript中docker-common/registryauthenticationprovider/registryauthenticationtoken.getDockerRegistryEndpointAuthenticationToken函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getDockerRegistryEndpointAuthenticationToken函数的具体用法?TypeScript getDockerRegistryEndpointAuthenticationToken怎么用?TypeScript getDockerRegistryEndpointAuthenticationToken使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getDockerRegistryEndpointAuthenticationToken函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: ACRAuthenticationTokenProvider

import RegistryAuthenticationToken from "docker-common/registryauthenticationprovider/registryauthenticationtoken"
import { getDockerRegistryEndpointAuthenticationToken } from "docker-common/registryauthenticationprovider/registryauthenticationtoken";

tl.setResourcePath(path.join(__dirname, '..' , 'task.json'));
// Change to any specified working directory
tl.cd(tl.getInput("cwd"));

// get the registry server authentication provider 
var registryType = tl.getInput("containerRegistryType", true);
const environmentVariableMaximumSize = 32766;
var registryAuthenticationToken: RegistryAuthenticationToken;
if(registryType ==  "Azure Container Registry"){
    registryAuthenticationToken = new ACRAuthenticationTokenProvider(tl.getInput("azureSubscriptionEndpoint"), tl.getInput("azureContainerRegistry")).getAuthenticationToken();
} 
else {
    registryAuthenticationToken = getDockerRegistryEndpointAuthenticationToken(tl.getInput("dockerRegistryEndpoint"));
}

// open kubectl connection and run the command
var connection = new ClusterConnection();
try
{
    connection.open(tl.getInput("kubernetesServiceEndpoint")).then(  
        () => { return run(connection, registryAuthenticationToken) }
    ).then(
       () =>  {
           tl.setResult(tl.TaskResult.Succeeded, "");
           connection.close();
       }
    ).catch((error) => {
       tl.setResult(tl.TaskResult.Failed, error.message)
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:31,代码来源:kubernetes.ts

示例2: getDockerRegistryEndpointAuthenticationToken

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()}`;
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:4,代码来源:createSecret.ts

示例3: require

import { getDockerRegistryEndpointAuthenticationToken } from "docker-common/registryauthenticationprovider/registryauthenticationtoken";
import Q = require('q');

tl.setResourcePath(path.join(__dirname, 'task.json'));

// get the registry server authentication provider 
var containerRegistryType = tl.getInput("containerregistrytype", true);
const environmentVariableMaximumSize = 32766;

var registryAuthenticationToken;
if (containerRegistryType == "Azure Container Registry") {
    registryAuthenticationToken = new ACRAuthenticationTokenProvider(tl.getInput("azureSubscriptionEndpoint"), tl.getInput("azureContainerRegistry")).getAuthenticationToken();
}
else {
    let endpointId = tl.getInput("dockerRegistryEndpoint");
    registryAuthenticationToken = getDockerRegistryEndpointAuthenticationToken(endpointId);
}

// Connect to any specified container host and/or registry 
var connection = new ContainerConnection();
connection.open(tl.getInput("dockerHostEndpoint"), registryAuthenticationToken);

// Run the specified command
var command = tl.getInput("command", true).toLowerCase();
/* tslint:disable:no-var-requires */

var dockerCommandMap = {
    "build an image": "./containerbuild",
    "build": "./containerbuild",
    "tag image": "./containertag",
    "tag": "./containertag",
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:31,代码来源:container.ts


注:本文中的docker-common/registryauthenticationprovider/registryauthenticationtoken.getDockerRegistryEndpointAuthenticationToken函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。