我正在尝试在 AzureDevOps 中构建管道(不使用经典编辑器)。到目前为止,我已经创建了以下 yaml 代码:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- adf_publish
pool:
vmImage: ubuntu-latest
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
- task: PublishBuildArtifacts@1
inputs:
- task: AzurePowerShell@5
inputs:
azureSubscription: 'NewConnectionName'
ScriptType: 'FilePath'
ScriptPath: '$(System.DefaultWorkingDirectory)/_Azure Data Factory-CP/drop/pre-and post-deployment.ps1'
ScriptArguments: '-armTemplate "$(System.DefaultWorkingDirectory)/_Azure Data Factory-CP/drop/ARMTemplateForFactory.json" -ResourceGroupName $(ResourceGroup) -DataFactoryName $(DataFactory) -predeployment $true -deleteDeployment $false'
azurePowerShellVersion: 'LatestVersion'
PathtoPublish: 'caplogic-warehouse-dev-df'
ArtifactName: 'drop'
publishLocation: 'Container'
当我验证代码时,出现以下错误:
/my-azure-pipelines.yml (Line: 21, Col: 10): Unexpected value ''
这是必须使用 yaml 的经验,因此不知道从哪里开始故障排除
对代码错误出在哪里有什么想法吗?
task: PublishBuildArtifacts@1
您的“输入”参数为空,如果您不使用任务,请删除该任务或添加所需的参数:https://learn.microsoft.com/fr-fr/azure/devops/pipelines/tasks/reference/发布构建工件-v1?view=azure-pipelines