【发布时间】:2021-01-26 10:38:45
【问题描述】:
我是 azure devops 的新手。我正在尝试通过 azure 管道在亚马逊 ec2 上部署我的 ionic5 angular 应用程序。每当我尝试运行管道时,它都会给出“解析管道 YAML 时遇到的错误: /build-ci.yml (Line: 2, Col: 3): A mapping was not expected”这个错误。 这是 yaml 文件代码。我被困在这里了。请帮忙。
trigger:
- task: CodeDeployDeployApplication@1
inputs:
awsCredentials: 'AWS Service Con'
regionName: 'us-east-1'
applicationName: 'Dev-erp-Frontend'
deploymentGroupName: 'Dev-erp-Frontend'
deploymentRevisionSource: 'workspace'
revisionBundle: 'Dev-erp-Frontend-Rev'
bucketName: 'Dev-erp-Frontend'
fileExistsBehavior: 'OVERWRITE'
batch: "true"
branches:
include:
- master
- dev
paths:
include:
- ./*
pr:
branches:
include:
- master
- dev
paths:
include:
- ./*
jobs:
- job: Build_Job
displayName: Build
pool:
vmImage: 'ubuntu-18.04'
demands:
- npm
steps:
- checkout: self
clean: false
# - powershell: 'npm cache clean --force'
# displayName: 'PowerShell Script'
# env:
# APPDATA: npm-cache
- task: Npm@1
displayName: 'Npm Install'
inputs:
workingDir: "./"
command: "ci"
- task: Npm@1
displayName: 'Lint Client App'
inputs:
workingDir: "./"
command: "custom"
customCommand: "run lint"
continueOnError: true
- task: Npm@1
displayName: 'Copy Assets'
inputs:
workingDir: "./"
command: "custom"
customCommand: "run copy-files"
continueOnError: false
- task: Npm@1
displayName: 'Build Client App'
inputs:
workingDir: "./"
command: "custom"
customCommand: "run build:prod"
# Archive files
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)'
includeRootFolder: true
archiveType: 'zip' # Options: zip, 7z, tar, wim
archiveFile: '$(Build.ArtifactStagingDirectory)/www.zip'
replaceExistingArchive: true
- task: CopyFiles@2
inputs:
Contents: 'www/**'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: 'titas-ecom-erp'
【问题讨论】:
-
嗨@Amitabh Biswas,这里有什么更新吗?请随时让我知道最新消息。或者,如果您有任何疑问,请随时在此处分享。
-
暂时不用担心。 yaml 文件运行顺利。没有问题
-
嗨@Amitabh Biswas,如果答案有帮助,我们可以accept it 作为答案,在这种情况下,其他人可以直接找到有用的解决方案。谢谢。
标签: azure amazon-ec2 yaml azure-pipelines