我在哪里将任务放在YAML文件中?
在下面的yaml中插入-task时,我会遇到错误...我在做什么错?
pool:
vmImage: ubuntu-latest
variables:
- group: variables
**- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
# Write your PowerShell commands here.
Write-Host "pullrequest"
Write-Host "PR Number is:-" $(System.PullRequest.PullRequestId)"
Write-Host "PR Number is:-" $(System.PullRequest.PullRequestNumber)"**
# Login to DockerHub
- script: docker login -u $(dockerId) -p $pass
env:
pass: $(dockerPassword)
displayName: Login to DockerHub
# Build and run tests
- script: |
docker pull $(dockerRegistry)/$(dockerImageName):cache-test-dependencies || true
docker pull $(dockerRegistry)/$(dockerImageName):cache-test || true
docker-compose --file=docker-compose.test.yml build
displayName: Build test Docker image
continueOnError: false
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
的成员
任务
必须是步骤
参考文档 ; 。添加。
在任务之前
task
must be a member ofsteps
Reference docs here; https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-task?view=azure-pipelines.
Add
Before your task.
为了详细介绍,您很可能会在此上进行阶段和工作:
阶段将使您与环境联系,同时如果运行多个工作,则作业将使您能够利用Parreellelism。
To elaborate more, additionally you most likely will want stages and jobs on this:
Stages will set you up to tie to environments, meanwhile jobs will set you up to take advantage of parrellelism if running multiple jobs.