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


TypeScript ParameterParserUtility.parse函数代码示例

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


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

示例1: _updateApplicationSettings

 private async _updateApplicationSettings(taskParameters: TaskParameters, imageName: string): Promise<void> {
     var appSettingsParameters = taskParameters.AppSettings;
     appSettingsParameters = appSettingsParameters ? appSettingsParameters.trim() : "";
     appSettingsParameters =  await this._getContainerRegistrySettings(imageName, null) + ' ' + appSettingsParameters;
     var appSettingsNewProperties = parse(appSettingsParameters);
     await this._appServiceUtility.updateAndMonitorAppSettings(appSettingsNewProperties);
 }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:7,代码来源:ContainerBasedDeploymentUtility.ts

示例2: validateParameterParserUtilityWithExtraSpaces

function validateParameterParserUtilityWithExtraSpaces() {
    var paramString = "-port         8080    -ErrorCode    -ErrorMessage     -Release.ReleaseName         Release-1173";
    var expectedJSON = JSON.stringify({
        "port": {
            value: "8080"
        },
        "ErrorCode": {
            value: ""
        },
        "ErrorMessage": {
            value: ""
        },
        "Release.ReleaseName":  {
            value: "Release-1173"
        }
    });

    var resultJSON = JSON.stringify(ParameterParserUtility.parse(paramString));

    if(expectedJSON == resultJSON) {
        console.log("PARAMETERPARSERUTILITY CASE 3 WITH EXTRA SPACES PASSED");
    }
    else {
        throw new Error("PARAMETERPARSERUTILITY CASE 3 WITH EXTRA SPACES FAILED");
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:26,代码来源:L0ParameterParserUtility.ts

示例3: DeployWebAppStep

    public async DeployWebAppStep() {
        var physicalPath: string = Constant.SiteRoot;
        var webPackage = this.taskParams.Package.getPath();

        if(this.taskParams.VirtualApplication) {
            physicalPath = await this.appServiceUtility.getPhysicalPath(this.taskParams.VirtualApplication);
            await this.kuduServiceUtility.createPathIfRequired(physicalPath);
            this.virtualApplicationPath = physicalPath;
        }

        webPackage = await FileTransformsUtility.applyTransformations(webPackage, this.taskParams);
        this.taskParams.Package = new Package(webPackage);

        var updateApplicationSetting = ParameterParser.parse(removeRunFromZipAppSetting)
        var deleteApplicationSetting = ParameterParser.parse(deleteOldRunFromZipAppSetting)
        await this.appServiceUtility.updateAndMonitorAppSettings(updateApplicationSetting, deleteApplicationSetting);
        
        if(deployUtility.canUseWebDeploy(this.taskParams.UseWebDeploy)) {
            let deploymentMethodtelemetry = '{"deploymentMethod":"Web Deploy"}';
            console.log("##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureWebAppDeployment]" + deploymentMethodtelemetry);

            tl.debug("Performing the deployment of webapp.");
            
            if(!tl.osType().match(/^Win/)) {
                throw Error(tl.loc("PublishusingwebdeployoptionsaresupportedonlywhenusingWindowsagent"));
            }
    
            var msDeployPublishingProfile = await this.appServiceUtility.getWebDeployPublishingProfile();
            await WebDeployUtility.publishUsingWebDeploy(this.taskParams,
                WebDeployUtility.constructWebDeployArguments(this.taskParams, msDeployPublishingProfile), this.appServiceUtility
            );
            
        }
        else {
            let deploymentMethodtelemetry = '{"deploymentMethod":"Zip API"}';
            console.log("##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureWebAppDeployment]" + deploymentMethodtelemetry);

            tl.debug("Initiated deployment via kudu service for webapp package : ");
            await this.kuduServiceUtility.deployWebPackage(webPackage, physicalPath, this.taskParams.VirtualApplication, this.taskParams.TakeAppOfflineFlag);
        }        

        await this.PostDeploymentStep();
    }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:43,代码来源:WindowsWebAppWebDeployProvider.ts

示例4: DeployWebAppStep

    public async DeployWebAppStep() {
        let deploymentMethodtelemetry = '{"deploymentMethod":"Zip Deploy"}';
        console.log("##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureWebAppDeployment]" + deploymentMethodtelemetry);

        var webPackage = await FileTransformsUtility.applyTransformations(this.taskParams.Package.getPath(), this.taskParams);

        if(this.taskParams.UseWebDeploy && this.taskParams.DeploymentType === DeploymentType.zipDeploy) {
            var _isMSBuildPackage = await this.taskParams.Package.isMSBuildPackage();
            if(_isMSBuildPackage) {
                throw Error(tl.loc("Publishusingzipdeploynotsupportedformsbuildpackage"));
            }
            else if(this.taskParams.VirtualApplication) {
                throw Error(tl.loc("Publishusingzipdeploynotsupportedforvirtualapplication"));
            }
            else if(this.taskParams.Package.getPackageType() === PackageType.war) {
                throw Error(tl.loc("Publishusingzipdeploydoesnotsupportwarfile"));
            }
        }

        if(tl.stats(webPackage).isDirectory()) {
            let tempPackagePath = deployUtility.generateTemporaryFolderOrZipPath(tl.getVariable('AGENT.TEMPDIRECTORY'), false);
            webPackage = await zipUtility.archiveFolder(webPackage, "", tempPackagePath);
            tl.debug("Compressed folder into zip " +  webPackage);
        }

        tl.debug("Initiated deployment via kudu service for webapp package : ");
        
        var updateApplicationSetting = ParameterParser.parse(removeRunFromZipAppSetting)
        var deleteApplicationSetting = ParameterParser.parse(deleteOldRunFromZipAppSetting)
        var isNewValueUpdated: boolean = await this.appServiceUtility.updateAndMonitorAppSettings(updateApplicationSetting, deleteApplicationSetting);

        if(!isNewValueUpdated) {
            await this.kuduServiceUtility.warmpUp();
        }

        this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage, this.taskParams.TakeAppOfflineFlag, 
            { slotName: this.appService.getSlot() });

        await this.PostDeploymentStep();
    }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:40,代码来源:WindowsWebAppZipDeployProvider.ts

示例5: _updateConfigurationDetails

    private async _updateConfigurationDetails(taskParameters: TaskParameters, imageName: string): Promise<void> {
        var startupCommand: string = taskParameters.StartupCommand;
        var configSettingsParameters = taskParameters.ConfigurationSettings;
        var appSettingsNewProperties = !!configSettingsParameters ? parse(configSettingsParameters.trim()): { };
        appSettingsNewProperties.appCommandLine = {
            'value': startupCommand
        }

        appSettingsNewProperties.linuxFxVersion = {
            'value': "DOCKER|" + imageName
        }
        tl.debug(`CONATINER UPDATE CONFIG VALUES : ${appSettingsNewProperties}`);
        await this._appServiceUtility.updateConfigurationSettings(appSettingsNewProperties);
    }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:14,代码来源:ContainerBasedDeploymentUtility.ts

示例6: DeployWebAppStep

    public async DeployWebAppStep() {
        tl.debug("Performing container based deployment.");

        if(this.taskParams.isFunctionApp) {
            var customApplicationSetting = ParameterParser.parse(linuxFunctionStorageSetting);
            await this.appServiceUtility.updateAndMonitorAppSettings(customApplicationSetting);
        }

        let containerDeploymentUtility: ContainerBasedDeploymentUtility = new ContainerBasedDeploymentUtility(this.appService);
        await containerDeploymentUtility.deployWebAppImage(this.taskParams);

        if(this.taskParams.ScriptType) {
            await this.kuduServiceUtility.runPostDeploymentScript(this.taskParams);
        }
        await this.appServiceUtility.updateScmTypeAndConfigurationDetails();
    }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:16,代码来源:ContainerWebAppDeploymentProvider.ts

示例7: validateParameterParserUtility

function validateParameterParserUtility() {
    var paramString = "-port 8080 -Release.ReleaseName Release-1173";
    var expectedJSON = JSON.stringify({
        "port": {
            value: "8080"
        },
        "Release.ReleaseName":  {
            value: "Release-1173"
        }
    });

    var resultJSON = JSON.stringify(ParameterParserUtility.parse(paramString));

    if(expectedJSON == resultJSON) {
        console.log("PARAMETERPARSERUTILITY CASE 1 PASSED");
    }
    else {
        throw new Error("PARAMETERPARSERUTILITY CASE 1 FAILED");
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:20,代码来源:L0ParameterParserUtility.ts

示例8: _updateWebAppSettings

 private _updateWebAppSettings(appSettingsParameters, webAppSettings): void {
     // In case of public repo, clear the connection details of a registry
     var dockerRespositoryAccess = tl.getInput('DockerRepositoryAccess', true);
     
     // Uncomment the below lines while supprting all registry types.
     // if(dockerRespositoryAccess === "public")
     // {
     //     deleteRegistryConnectionSettings(webAppSettings);
     // }
     
     var parsedAppSettings = parse(appSettingsParameters);
     for (var settingName in parsedAppSettings) {
         var setting = settingName.trim();
         var settingVal = parsedAppSettings[settingName].value;
         settingVal = settingVal ? settingVal.trim() : "";
 
         if(setting) {
             webAppSettings["properties"][setting] = settingVal;
         }
     }
 }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:21,代码来源:ContainerBasedDeploymentUtility.ts

示例9: DeployWebAppStep

    public async DeployWebAppStep() {
        let packageType = this.taskParams.Package.getPackageType();
        let deploymentMethodtelemetry = packageType === PackageType.war ? '{"deploymentMethod":"War Deploy"}' : '{"deploymentMethod":"Zip Deploy"}';
        console.log("##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureWebAppDeployment]" + deploymentMethodtelemetry);

        tl.debug('Performing Linux built-in package deployment');
        var isNewValueUpdated: boolean = false;

        if(this.taskParams.isFunctionApp) {
            var linuxFunctionRuntimeSetting = "";
            if(this.taskParams.RuntimeStack){
                linuxFunctionRuntimeSetting = linuxFunctionRuntimeSettingName + linuxFunctionRuntimeSettingValue.get(this.taskParams.RuntimeStack);
            }
            var linuxFunctionAppSetting = linuxFunctionRuntimeSetting + linuxFunctionStorageSetting;
            var customApplicationSetting = ParameterParser.parse(linuxFunctionAppSetting);
            isNewValueUpdated = await this.appServiceUtility.updateAndMonitorAppSettings(customApplicationSetting);
        }
        
        if(!isNewValueUpdated) {
            await this.kuduServiceUtility.warmpUp();
        }
        
        switch(packageType){
            case PackageType.folder:
                let tempPackagePath = deployUtility.generateTemporaryFolderOrZipPath(tl.getVariable('AGENT.TEMPDIRECTORY'), false);
                let archivedWebPackage = await zipUtility.archiveFolder(this.taskParams.Package.getPath(), "", tempPackagePath);
                tl.debug("Compressed folder into zip " +  archivedWebPackage);
                this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(archivedWebPackage, this.taskParams.TakeAppOfflineFlag, 
                    { slotName: this.appService.getSlot() });
            break;
            case PackageType.zip:
                this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(this.taskParams.Package.getPath(), this.taskParams.TakeAppOfflineFlag, 
                { slotName: this.appService.getSlot() });
            break;

            case PackageType.jar:
                tl.debug("Initiated deployment via kudu service for webapp jar package : "+ this.taskParams.Package.getPath());
                var folderPath = await webCommonUtility.generateTemporaryFolderForDeployment(false, this.taskParams.Package.getPath(), PackageType.jar);
                var jarName = webCommonUtility.getFileNameFromPath(this.taskParams.Package.getPath(), ".jar");
                var destRootPath = "/home/site/wwwroot/";
                var script = 'java -jar "' + destRootPath + jarName + '.jar' + '" --server.port=80';
                var initScriptFileName = "startupscript_" + jarName + ".sh";
                var initScriptFile = path.join(folderPath, initScriptFileName);
                var destInitScriptPath = destRootPath + initScriptFileName;
                if(!this.taskParams.AppSettings) {
                    this.taskParams.AppSettings = "-INIT_SCRIPT " + destInitScriptPath;
                }
                if(this.taskParams.AppSettings.indexOf("-INIT_SCRIPT") < 0) {
                    this.taskParams.AppSettings += " -INIT_SCRIPT " + destInitScriptPath;
                }
                this.taskParams.AppSettings = this.taskParams.AppSettings.trim();
                tl.writeFile(initScriptFile, script, { encoding: 'utf8' });
                var output = await webCommonUtility.archiveFolderForDeployment(false, folderPath);
                var webPackage = output.webDeployPkg;
                tl.debug("Initiated deployment via kudu service for webapp jar package : "+ webPackage);
                this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage, this.taskParams.TakeAppOfflineFlag, 
                { slotName: this.appService.getSlot() });
            break;

            case PackageType.war:
                tl.debug("Initiated deployment via kudu service for webapp war package : "+ this.taskParams.Package.getPath());
                var warName = webCommonUtility.getFileNameFromPath(this.taskParams.Package.getPath(), ".war");
                this.zipDeploymentID = await this.kuduServiceUtility.deployUsingWarDeploy(this.taskParams.Package.getPath(), 
                { slotName: this.appService.getSlot() }, warName);
            break;

            default:
                throw new Error(tl.loc('Invalidwebapppackageorfolderpathprovided', this.taskParams.Package.getPath()));
        }

        await this.appServiceUtility.updateStartupCommandAndRuntimeStack(this.taskParams.RuntimeStack, this.taskParams.StartupCommand);

        await this.PostDeploymentStep();
    }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:74,代码来源:BuiltInLinuxWebAppDeploymentProvider.ts


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