本文整理汇总了TypeScript中azure-pipelines-task-lib/task.getEndpointAuthorizationParameter函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getEndpointAuthorizationParameter函数的具体用法?TypeScript getEndpointAuthorizationParameter怎么用?TypeScript getEndpointAuthorizationParameter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getEndpointAuthorizationParameter函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: fetchACRCredential
public static fetchACRCredential(endpointName: string, registryObject: ACRRegistry): RegistryCredential {
if (!endpointName || !registryObject) {
throw Error(`endpointName or registryName is empty when fetching ACR credential`);
}
return new RegistryCredential(tl.getEndpointAuthorizationParameter(endpointName, 'serviceprincipalid', true),
tl.getEndpointAuthorizationParameter(endpointName, 'serviceprincipalkey', true),
registryObject.loginServer);
}
示例2: createOptimizelyClientInstance
public createOptimizelyClientInstance(): OptimizelyXClient {
let endpointId: string = this.taskInputs.getEndpointId();
let endpointUrl: string = tl.getEndpointUrl(endpointId, false);
let pat: string = tl.getEndpointAuthorizationParameter(endpointId, 'apitoken', false);
let oxClient = new OptimizelyXClient(endpointUrl, pat);
return oxClient;
}
示例3: constructor
constructor() {
const serverUrl: string = tl.getVariable('System.TeamFoundationCollectionUri');
const serverCreds: string = tl.getEndpointAuthorizationParameter('SYSTEMVSSCONNECTION', 'ACCESSTOKEN', false);
const authHandler = getPersonalAccessTokenHandler(serverCreds);
const proxy = tl.getHttpProxyConfiguration();
const options = proxy ? { proxy, ignoreSslError: true } : undefined;
this.serverConnection = new WebApi(serverUrl, authHandler, options);
}
示例4:
// ===================================================================================================
// TODO: repoUrl could actually be determined as follows:
// var tfsUri = tl.getVariable("System.TeamFoundationServerURI");
// var tfsProject = tl.getVariable("System.TeamProject");
// var repoName = tl.getVariable("Build.RepositoryName");
// var repoUrl = `${tfsUri}/${tfsProject}/${repoName}`;
// unfortunately, the repo name isn't correct in the release vars, so the user must pass it in for now
// ===================================================================================================
var repoUrl = tl.getInput("repoUrl", true);
var pat = tl.getInput("pat", false);
// get build vars
var sourceBranch = tl.getVariable("Build.SourceBranchName");
var buildSourceCommitId = tl.getVariable("Build.SourceVersion");
var token = tl.getEndpointAuthorizationParameter("SystemVssConnection", "AccessToken", false);
tl.debug(`mergeType: ${mergeType}`);
tl.debug(`branchesToMerge: ${branchesToMergeStr}`);
tl.debug(`targetBranch: ${targetBranch}`);
//tl.debug(`testMergeAll: ${testMergeAll}`);
tl.debug(`sourceCommitId: ${sourceCommitId}`);
tl.debug(`remoteName: ${remoteName}`);
tl.debug(`sourceBranch: ${sourceBranch}`);
tl.debug(`buildSourceCommitId: ${buildSourceCommitId}`);
tl.debug(`repoUrl: ${repoUrl}`);
if (ut.isEmpty(pat)) {
tl.debug("No PAT was provided");
} else {
tl.debug("A PAT was provided");
}