• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript task.getInput函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: searchAndReplace

function searchAndReplace(value: string): string {
    const method = tl.getInput("searchReplaceMethod", true);
    const search = tl.getInput("searchValue") || "";
    const replacement = tl.getInput("replacementValue") || "";

    if (method === "basic") {
        return value.split(search).join(replacement);
    } else {
        const regexOptions = tl.getInput("regexOptions", false);
        let searchExpression: RegExp;

        if (regexOptions) {
            searchExpression = new RegExp(search, regexOptions);
        } else {
            searchExpression = new RegExp(search);
        }

        if (method === "match") {
            const result = value.match(searchExpression);
            if (!result || result.length === 0) {
                tl.warning("Found no matches");
                return "";
            } else {
                return result[0];
            }
        }
        if (method === "regex") {
            return value.replace(searchExpression, replacement);
        }
    }
    return value;
}
开发者ID:jessehouwing,项目名称:vsts-variable-tasks,代码行数:32,代码来源:vsts-variable-transform.ts


示例2: promiseRetry

    await common.runTfx(async tfx => {
        try
        {
            tfx.arg(["extension", "isvalid", "--json", "--no-color"]);

            common.setTfxMarketplaceArguments(tfx);
            common.validateAndSetTfxManifestArguments(tfx);

            const options = {
                retries: +tl.getInput("maxRetries", false) || 10,
                factor: 1,
                minTimeout: 1000 * 60 * (+tl.getInput("minTimeout", false) || 1),
                maxTimeout: 1000 * 60 * (+tl.getInput("maxTimeout", false) || 15),
                randomize: false
            };

            await promiseRetry(options,
                (retry, attempt) => {
                    tl.debug(`Attempt: ${attempt}`);
                    const result = tfx.execSync({ silent: false, failOnStdErr: false } as any);
                    const json = JSON.parse(result.stdout);
                    switch (json.status) {
                        case "pending":
                            return retry(json.status);
                        case "success":
                            return json.status;
                        default:
                            throw json.status;
                    }
            });
            tl.setResult(tl.TaskResult.Succeeded, "Extension is valid.");
        } catch (err) {
            tl.setResult(tl.TaskResult.Failed, `Extension validation failed: ${err}`);
        }
    });
开发者ID:Microsoft,项目名称:vsts-extension-build-release-tasks,代码行数:35,代码来源:IsValidExtension.ts


示例3: run

async function run() {
  try {
    if (action === 'Build module images') {
      console.log(tl.loc('BuildingModules'));
      await BuildImage.run();
      console.log(tl.loc('BuildingModulesFinished'));
    } else if (action === 'Push module images') {
      console.log(tl.loc('PushingModules'));
      telemetryEvent.isACR = tl.getInput("containerregistrytype", true) === "Azure Container Registry";
      await PushImage.run();
      console.log(tl.loc('PushingModulesFinished'));
    } else if (action === 'Deploy to IoT Edge devices') {
      console.log(tl.loc('StartDeploy'));
      telemetryEvent.hashIoTHub = util.sha256(tl.getInput("iothubname", true));
      await DeployImage.run(telemetryEvent);
      console.log(tl.loc('FinishDeploy'));
    }
    telemetryEvent.isSuccess = true;
    tl.setResult(tl.TaskResult.Succeeded, "");
  } catch (e) {
    telemetryEvent.isSuccess = false;
    tl.setResult(tl.TaskResult.Failed, e)
  } finally {
    telemetryEvent.taskTime = (+new Date() - (+startTime)) / 1000;
    if (telemetryEnabled) {
      trackEvent(action, telemetryEvent);
    }
    commonTelemetry.emitTelemetry('TaskEndpointId', "AzureIoTEdgeV2", telemetryEvent);
  }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:30,代码来源:index.ts


示例4: isServerBasedRun

function isServerBasedRun(): boolean {
    const batchType = tl.getInput('distributionBatchType');
    if (batchType && batchType === 'basedOnTestCases') {
        const batchSize = tl.getInput('batchingBasedOnAgentsOption');
        if (batchSize && batchSize === 'customBatchSize') {
            return true;
        }
    } else if (batchType && batchType === 'basedOnExecutionTime') {
        return true;
    } else if (batchType && batchType === 'basedOnAssembly') {
        return true;
    }

    const testType = tl.getInput('testSelector');
    tl.debug('Value of Test Selector :' + testType);
    if (testType.toLowerCase() === 'testplan' || testType.toLowerCase() === 'testrun') {
        return true;
    }

    const parallelExecution = tl.getVariable('System.ParallelExecutionType');
    tl.debug('Value of ParallelExecutionType :' + parallelExecution);

    if (parallelExecution && parallelExecution.toLowerCase() === 'multimachine') {
        const dontDistribute = tl.getBoolInput('dontDistribute');
        if (dontDistribute) {
            return false;
        }
        return true;
    }

    return false;
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:32,代码来源:runvstest.ts


示例5: main

async function main(): Promise<void> {
	var feed = getProjectAndFeedIdFromInputParam("feed");
	if(feed.projectId) {
		throw new Error(tl.loc("UnsupportedProjectScopedFeeds"));
	}
	let feedId = feed.feedId;
	let regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
	let packageId = tl.getInput("definition");

	if(!regexGuid.test(packageId)){
		packageId = "Nuget_" + tl.getInput("definition");
	}

	let version = tl.getInput("version");
	let downloadPath = tl.getInput("downloadPath");
	let collectionUrl = tl.getVariable("System.TeamFoundationCollectionUri");

	var accessToken = getAuthToken();
	var credentialHandler = vsts.getBearerHandler(accessToken);
	var vssConnection = new vsts.WebApi(collectionUrl, credentialHandler);
	var coreApi = vssConnection.getCoreApi();
	const retryLimitValue: string = tl.getVariable("VSTS_HTTP_RETRY");
	const retryLimit: number = (!!retryLimitValue && !isNaN(parseInt(retryLimitValue))) ? parseInt(retryLimitValue) : 4;
	tl.debug(`RetryLimit set to ${retryLimit}`);

	await executeWithRetries("downloadPackage", () => downloadPackage(collectionUrl, accessToken, credentialHandler, feedId, packageId, version, downloadPath).catch((reason) => {
		throw reason;
	}), retryLimit);
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:29,代码来源:download.ts


示例6: usePythonVersion

(async () => {
    try {
        task.setResourcePath(path.join(__dirname, 'task.json'));
        await usePythonVersion({
            versionSpec: task.getInput('versionSpec', true),
            addToPath: task.getBoolInput('addToPath', true),
            architecture: task.getInput('architecture', true)
        },
        getPlatform());
        task.setResult(task.TaskResult.Succeeded, "");
    } catch (error) {
        task.setResult(task.TaskResult.Failed, error.message);
    }
})();
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:14,代码来源:main.ts


示例7:

var jarsigning = (fn: string) => {
    // file must exist
    tl.checkPath(fn, 'file to sign');

    var jarsigner = tl.which("jarsigner", false);
    if (!jarsigner) {
        var java_home = tl.getVariable('JAVA_HOME');
        if (!java_home) {
            throw tl.loc('JavaHomeNotSet');
        }

        jarsigner = tl.resolve(java_home, 'bin', 'jarsigner');
    }

    var jarsignerRunner = tl.tool(jarsigner);

    // Get keystore file path for signing
    var keystoreFile = tl.getTaskVariable('KEYSTORE_FILE_PATH');

    // Get keystore alias
    var keystoreAlias = tl.getInput('keystoreAlias', true);

    var keystorePass = tl.getInput('keystorePass', false);

    var keyPass = tl.getInput('keyPass', false);

    var jarsignerArguments = tl.getInput('jarsignerArguments', false);

    jarsignerRunner.arg(['-keystore', keystoreFile]);

    if (keystorePass) {
        jarsignerRunner.arg(['-storepass', keystorePass]);
    }

    if (keyPass) {
        jarsignerRunner.arg(['-keypass', keyPass]);
    }

    if (jarsignerArguments) {
        jarsignerRunner.line(jarsignerArguments);
    }

    var unsignedFn = fn + ".unsigned";
    var success = tl.mv(fn, unsignedFn, '-f', false);

    jarsignerRunner.arg(['-signedjar', fn, unsignedFn, keystoreAlias]);

    return jarsignerRunner.exec(null);
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:49,代码来源:androidsigning.ts


示例8: run

async function run() {
    try {
        tl.setResourcePath(path.join(__dirname, 'task.json'));

        // Check platform is macOS since demands are not evaluated on Hosted pools
        if (os.platform() !== 'darwin') {
            console.log(tl.loc('InstallRequiresMac'));
        } else {
            let keychain: string = tl.getInput('keychain');
            let keychainPath: string = tl.getTaskVariable('APPLE_CERTIFICATE_KEYCHAIN');

            let deleteCert: boolean = tl.getBoolInput('deleteCert');
            let hash: string = tl.getTaskVariable('APPLE_CERTIFICATE_SHA1HASH');
            if (deleteCert && hash) {
                sign.deleteCert(keychainPath, hash);
            }

            let deleteKeychain: boolean = false;
            if (keychain === 'temp') {
                deleteKeychain = true;
            } else if (keychain === 'custom') {
                deleteKeychain = tl.getBoolInput('deleteCustomKeychain');
            }

            if (deleteKeychain && keychainPath) {
                await sign.deleteKeychain(keychainPath);
            }
        }
    } catch (err) {
        tl.warning(err);
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:32,代码来源:postinstallcert.ts


示例9: run

async function run() {
    try {
        // Configure localization
        tl.setResourcePath(path.join(__dirname, 'task.json'));

        // Get files to be signed
        const filesPattern: string = tl.getInput('files', true);

        // Signing the APK?
        const apksign: boolean = tl.getBoolInput('apksign');

        // Zipaligning the APK?
        const zipalign: boolean = tl.getBoolInput('zipalign');

        // Resolve files for the specified value or pattern
        const filesToSign: string[] = tl.findMatch(null, filesPattern);

        // Fail if no matching files were found
        if (!filesToSign || filesToSign.length === 0) {
            throw new Error(tl.loc('NoMatchingFiles', filesPattern));
        }

        for (const file of filesToSign) {
            if (zipalign) {
                await zipaligning(file);
            }

            if (apksign) {
                await apksigning(file);
            }
        }
    } catch (err) {
        tl.setResult(tl.TaskResult.Failed, err);
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:35,代码来源:androidsigning.ts


示例10: main

async function main(): Promise<void> {
    tl.setResourcePath(path.join(__dirname, 'task.json'));
    let packagingLocation: pkgLocationUtils.PackagingLocation;
    try {
        packagingLocation = await pkgLocationUtils.getPackagingUris(pkgLocationUtils.ProtocolType.Npm);
    } catch (error) {
        tl.debug('Unable to get packaging URIs, using default collection URI');
        tl.debug(JSON.stringify(error));
        const collectionUrl = tl.getVariable('System.TeamFoundationCollectionUri');
        packagingLocation = {
            PackagingUris: [collectionUrl],
            DefaultPackagingUri: collectionUrl
        };
    }
    const forcedUrl = tl.getVariable('Npm.PackagingCollectionUrl');
    if (forcedUrl) {
        packagingLocation.DefaultPackagingUri = forcedUrl;
        packagingLocation.PackagingUris.push(forcedUrl);
    }

    await _logNpmStartupVariables(packagingLocation);

    const command = tl.getInput(NpmTaskInput.Command);
    switch (command) {
        case NpmCommand.Install:
            return npmCustom.run(packagingLocation, NpmCommand.Install);
        case NpmCommand.Publish:
            return npmPublish.run(packagingLocation);
        case NpmCommand.Custom:
            return npmCustom.run(packagingLocation);
        default:
            tl.setResult(tl.TaskResult.Failed, tl.loc('UnknownCommand', command));
            return;
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:35,代码来源:npm.ts


示例11: installVsTestPlatformToolFromCustomFeed

    // Installs the test platform from a custom feed provided by the user along with credentials for authentication against said feed
    public async installVsTestPlatformToolFromCustomFeed(packageSource: string, versionSelectorInput: string, testPlatformVersion: string, username: string, password: string) {
        let tempConfigFilePath = null;
        try {
            try {
                if (!helpers.isNullEmptyOrUndefined(password)) {
                    tl.debug('Attempting to write feed details along with provided credentials to temporary config file.');
                    tempConfigFilePath = helpers.GenerateTempFile(`${uuid.v1()}.config`);
                    const feedId = uuid.v1();
                    this.prepareNugetConfigFile(packageSource, tempConfigFilePath, username, password, feedId);
                    packageSource = feedId;
                    ci.addToConsolidatedCi('passwordProvided', 'true');
                    ci.addToConsolidatedCi('usernameProvided', `${!helpers.isNullEmptyOrUndefined(username)}`);
                } else {
                    packageSource = tl.getInput(constants.customFeed);
                    tl.debug(`Credentials were not provided. Skipping writing to config file. Will use custom package feed provided by user ${packageSource}`);
                }
            } catch (error) {
                tl.error(error);
                console.log(tl.loc('LatestStableCached'));
                // Look for the latest stable version available in the cache as a fallback.
                testPlatformVersion = 'x';
                tempConfigFilePath = null;
            }

            await this.installVsTestPlatformToolFromSpecifiedFeed(packageSource, testPlatformVersion, versionSelectorInput, tempConfigFilePath);

        } finally {
            helpers.cleanUpTempConfigFile(tempConfigFilePath);
        }
    }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:31,代码来源:nugetfeedinstaller.ts


示例12: findAndroidTool

const apksigning = (fn: string) => {
    // file must exist
    tl.checkPath(fn, 'file to sign');

    let apksigner = tl.getInput('apksignerLocation', false);

    // if the tool path is not set, let's find one (anyone) from the SDK folder
    if (!apksigner) {
        apksigner = findAndroidTool('apksigner');
    }

    const apksignerRunner = tl.tool(apksigner);

    // Get keystore file path for signing
    const keystoreFile = tl.getTaskVariable('KEYSTORE_FILE_PATH');

    // Get keystore alias
    const keystoreAlias = tl.getInput('keystoreAlias', true);

    const keystorePass = tl.getInput('keystorePass', false);

    const keyPass = tl.getInput('keyPass', false);

    const apksignerArguments = tl.getInput('apksignerArguments', false);

    apksignerRunner.arg(['sign', '--ks', keystoreFile]);

    if (keystorePass) {
        apksignerRunner.arg(['--ks-pass', 'pass:' + keystorePass]);
    }

    if (keystoreAlias) {
        apksignerRunner.arg(['--ks-key-alias', keystoreAlias]);
    }

    if (keyPass) {
        apksignerRunner.arg(['--key-pass', 'pass:' + keyPass]);
    }

    if (apksignerArguments) {
        apksignerRunner.line(apksignerArguments);
    }

    apksignerRunner.arg([fn]);

    return apksignerRunner.exec(null);
};
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:47,代码来源:androidsigning.ts


示例13: run

async function run() {
    tl.setResourcePath(path.join(__dirname, 'task.json'));
    let indexFile = path.join(tl.getVariable("SAVE_NPMRC_PATH"), 'index.json');
    if (tl.exist(indexFile)) {
        let indexFileText = fs.readFileSync(indexFile, 'utf8');
        let jsonObject = JSON.parse(indexFileText);
        let npmrcIndex = JSON.stringify(jsonObject[tl.getInput(constants.NpmAuthenticateTaskInput.WorkingFile)]);
        util.restoreFileWithName(tl.getInput(constants.NpmAuthenticateTaskInput.WorkingFile), npmrcIndex, tl.getVariable("SAVE_NPMRC_PATH"));
        console.log(tl.loc("RevertedChangesToNpmrc", tl.getInput(constants.NpmAuthenticateTaskInput.WorkingFile)));
        if (fs.readdirSync(tl.getVariable("SAVE_NPMRC_PATH")).length == 1) {
            tl.rmRF(tl.getVariable("NPM_AUTHENTICATE_TEMP_DIRECTORY"));
        }
    }
    else {
        console.log(tl.loc("NoIndexJsonFile"));
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:17,代码来源:npmauthcleanup.ts


示例14: getRegistryAuthenticationToken

function getRegistryAuthenticationToken(): RegistryCredential {
  // get the registry server authentication provider 
  var registryType: string = tl.getInput("containerregistrytype", true);
  let token: RegistryCredential;

  if (registryType == "Azure Container Registry") {
    let acrObject: ACRRegistry = JSON.parse(tl.getInput("azureContainerRegistry"));
    token = RegistryCredentialFactory.fetchACRCredential(tl.getInput("azureSubscriptionEndpoint"), acrObject);
  }
  else {
    token = RegistryCredentialFactory.fetchGenericCredential(tl.getInput("dockerRegistryEndpoint"));
  }

  if (token == null || token.username == null || token.password == null || token.serverUrl == null) {
    throw Error(tl.loc('ContainerRegistryInvalid', JSON.stringify(token)));
  }
  return token;
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:18,代码来源:pushimage.ts


示例15: isMultiConfigOnDemandRun

function isMultiConfigOnDemandRun(): boolean {
    const testType = tl.getInput('testSelector');
    const parallelExecution = tl.getVariable('System.ParallelExecutionType');

    if (testType && testType.toLowerCase() === 'testrun' && parallelExecution && parallelExecution.toLowerCase() === 'multiconfiguration') {
        return true;
    }

    return false;
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:10,代码来源:runvstest.ts


示例16: run

async function run() {
    let packageType = tl.getInput('packageType') || "sdk";
    let versionSpec = tl.getInput('version');
    if (versionSpec) {
        console.log(tl.loc("ToolToInstall", packageType, versionSpec));
        let installationPath = tl.getInput('installationPath');
        if (!installationPath) {
            installationPath = path.join(tl.getVariable('Agent.ToolsDirectory'), "dotnet");
        }
        let includePreviewVersions: boolean = tl.getBoolInput('includePreviewVersions');

        var versionSpecParts = new VersionParts(versionSpec);

        let versionFetcher = new DotNetCoreVersionFetcher();
        let versionInfo: VersionInfo = await versionFetcher.getVersionInfo(versionSpecParts.versionSpec, packageType, includePreviewVersions);
        if (!versionInfo) {
            throw tl.loc("MatchingVersionNotFound", versionSpecParts.versionSpec);
        }

        let dotNetCoreInstaller = new VersionInstaller(packageType, installationPath);
        if (!dotNetCoreInstaller.isVersionInstalled(versionInfo.getVersion())) {
            await dotNetCoreInstaller.downloadAndInstall(versionInfo, versionFetcher.getDownloadUrl(versionInfo));
        }

        tl.prependPath(installationPath);

        // Set DOTNET_ROOT for dotnet core Apphost to find runtime since it is installed to a non well-known location.
        tl.setVariable('DOTNET_ROOT', installationPath);

        // By default disable Multi Level Lookup unless user wants it enabled.
        let performMultiLevelLookup = tl.getBoolInput("performMultiLevelLookup", false);
        tl.setVariable("DOTNET_MULTILEVEL_LOOKUP", !performMultiLevelLookup ? "0" : "1");
    }

    // Install NuGet version specified by user or 4.4.1 in case none is specified
    // Also sets up the proxy configuration settings.
    const nugetVersion = tl.getInput('nugetVersion') || '4.4.1';
    await NuGetInstaller.installNuGet(nugetVersion);

    // Add dot net tools path to "PATH" environment variables, so that tools can be used directly.
    addDotNetCoreToolPath();
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:42,代码来源:usedotnet.ts


示例17: attemptPackageDownload

    // Attemps to download the package and on failure looks for the latest stable version already present in the cache
    public async attemptPackageDownload(packageSource: string, testPlatformVersion: string, nugetConfigFilePath: string) : Promise<string> {
        let vstestPlatformInstalledLocation;
        try {
            tl.debug(`Could not find ${constants.packageId}.${testPlatformVersion} in the tools cache. Fetching it from nuget.`);

            // Download the required version and cache it
            vstestPlatformInstalledLocation = await this.acquireAndCacheVsTestPlatformNuget(packageSource,
                testPlatformVersion, nugetConfigFilePath);

        } catch (error) {
            tl.error(tl.loc('TestPlatformDownloadFailed', testPlatformVersion, error));

            if ((tl.getInput(constants.packageFeedSelector) === constants.nugetOrg || tl.getInput(constants.packageFeedSelector) === constants.customFeed)
                && tl.getInput(constants.versionSelector) === constants.specificVersion) {
                return null;
            }

            console.log(tl.loc('LatestStableCached'));
            testPlatformVersion = 'x';

            ci.addToConsolidatedCi('downloadSucceeded', 'false');
            ci.publishEvent('DownloadFailed', { action: 'getLatestAvailableInCache', error: error } );
            startTime = perf();

            // Download failed, look for the latest version available in the cache
            vstestPlatformInstalledLocation = toolLib.findLocalTool(constants.toolFolderName, testPlatformVersion);

            ci.addToConsolidatedCi('secondCacheLookupTime', perf() - startTime);

            // No version found in cache, fail the task
            if (!vstestPlatformInstalledLocation || vstestPlatformInstalledLocation === 'undefined') {
                ci.addToConsolidatedCi('secondCacheLookupSucceeded', 'false');
                ci.addToConsolidatedCi('failureReason', constants.downloadFailed);
                tl.error(tl.loc('NoPackageFoundInCache'));
                throw new Error(tl.loc('FailedToAcquireTestPlatform'));
            }

            ci.addToConsolidatedCi('secondCacheLookupSucceeded', 'true');
        }

        return vstestPlatformInstalledLocation;
    }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:43,代码来源:nugetdownloadhelper.ts


示例18: run

async function run() {
    try {
        taskLib.setResourcePath(path.join(__dirname, 'task.json'));

        const versionSpec = taskLib.getInput('versionSpec', false) || DEFAULT_NUGET_VERSION;
        const checkLatest = taskLib.getBoolInput('checkLatest', false);
        await nuGetGetter.getNuGet(versionSpec, checkLatest, true);
    } catch (error) {
        console.error('ERR:' + error.message);
        taskLib.setResult(taskLib.TaskResult.Failed, '');
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:12,代码来源:nugettoolinstaller.ts


示例19: constructor

 constructor() {
   try {
     this.endpointId = tl.getInput('OptimizelyXEndpoint', true);
     this.action = tl.getInput('Action', true);
     this.environmentName = tl.getInput("Environment");
     this.projectId = tl.getInput('Project', true);
     this.experimentId = tl.getInput('Experiment', true);
     this.totalTraffic = tl.getInput('Traffic', true);
     this.trafficByVariation = tl.getInput('TrafficByVariation', true);
     this.audience = tl.getInput('Audience');
   } catch (error) {
     throw new Error(tl.loc("ConstructorFailed", error.message));
   }
 }
开发者ID:Microsoft,项目名称:vsts-rm-extensions,代码行数:14,代码来源:OptimizelyTaskParameter.ts


示例20: getCustomRegistries

export async function getCustomRegistries(packagingLocation: PackagingLocation): Promise<NpmRegistry[]> {
    const workingDir = tl.getInput(NpmTaskInput.WorkingDir) || process.cwd();
    const npmRegistries: INpmRegistry[] = await npmutil.getLocalNpmRegistries(workingDir, packagingLocation.PackagingUris);
    const registryLocation = tl.getInput(NpmTaskInput.CustomRegistry);
    switch (registryLocation) {
        case RegistryLocation.Feed:
            tl.debug(tl.loc('UseFeed'));
            const feedId = tl.getInput(NpmTaskInput.CustomFeed, true);
            npmRegistries.push(await NpmRegistry.FromFeedId(packagingLocation.DefaultPackagingUri, feedId, null));
            break;
        case RegistryLocation.Npmrc:
            tl.debug(tl.loc('UseNpmrc'));
            const endpointIds = tl.getDelimitedInput(NpmTaskInput.CustomEndpoint, ',');
            if (endpointIds && endpointIds.length > 0) {
                await Promise.all(endpointIds.map(async e => {
                    npmRegistries.push(await NpmRegistry.FromServiceEndpoint(e, true));
                }));
            }
            break;
    }
    return npmRegistries;
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:22,代码来源:npmcustom.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript task.getPathInput函数代码示例发布时间:2022-05-25
下一篇:
TypeScript task.getHttpProxyConfiguration函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap