相关疑难解决方法(0)

在YAML中,如何在多行中断字符串?

在YAML中,我有一个非常长的字符串.我想将它保留在我的编辑器的80列(或左右)视图中,所以我想打破字符串.这是什么语法?

换句话说,我有这个:

Key: 'this is my very very very very very very long string'
Run Code Online (Sandbox Code Playgroud)

我想要这个(或者这个效果):

Key: 'this is my very very very ' +
     'long string'
Run Code Online (Sandbox Code Playgroud)

我想使用上面的引号,所以我不需要在字符串中转义任何东西.

string syntax yaml

1388
推荐指数
8
解决办法
58万
查看次数

Azure管道ARM部署任务YAML多行

是否可以在 Azure Pipelines 任务中的 YAML 中使用多行?例如,对于 ARM 部署任务,有一个overrideParameters属性。如果可以将其分成几行而不是将所有内容都放在一行中,那就太好了:

- task: AzureResourceManagerTemplateDeployment@3
          displayName: 'ARM deploy MyFunctionAPP'
          inputs:
            deploymentScope: 'Resource Group'
            azureResourceManagerConnection: ${{ parameters.serviceConnection }}
            subscriptionId: ${{ parameters.subscriptionId }}
            action: 'Create Or Update Resource Group'
            resourceGroupName: ${{ parameters.resourceGroupName }}
            location: 'West Europe'
            templateLocation: 'Linked artifact'
            csmFile: '$(ARMtemplatesPath)\MyFunctionAPP\template.json'
            csmParametersFile: '$(ARMtemplatesPath)\MyFunctionAPP\parameters.json'
            deploymentMode: 'Incremental'
            overrideParameters: '-environment_name ${{ parameters.environmentName }} -vnetAddressPrefix ${{ parameters.vnetAddressPrefix }} -subnet1Prefix ${{ parameters.subnet1Prefix }} -APIkey ${{ parameters.APIkey }} -queueName ${{ parameters.queueNameMyQueue }} -SendGridAPIkey ${{ parameters.SendGridAPIkey }} -StorageConnectionAppSetting ${{ …
Run Code Online (Sandbox Code Playgroud)

yaml azure-pipelines

2
推荐指数
1
解决办法
4680
查看次数

标签 统计

yaml ×2

azure-pipelines ×1

string ×1

syntax ×1