I am trying to copy a video file from GPM to app/dist/asset/images folder before building and deploying docker image.Getting Unexpected value 'Steps' at line 27.
YML file works fine if I remove the step to copy the video file.
azure-pipelines.yml
trigger:
branches:
include: ['*']
pool:
name: Default
# templates repo
resources:
repositories:
- repository: templates
type: git
name: comp.app.common.devops-templates
ref: master
# Global Variables
variables:
# necessary variables defined in this template
- template: azure-templates/vars/abc-vars.yml@templates
- name: dockerRepoName
value: 'docker-it/library/xyz'
# needed for k8 deployment
- name: helmReleaseName
value: xyz
stages:
- steps:
- bash: 'curl -o aa.mp4 https://gpm.mmm.com/endpoints/Application/content/xyz/bb.mp4'
workingDirectory: '$(System.DefaultWorkingDirectory)/_hh_app/drop/app/dist/assets/images'
displayName: 'Download Assets'
# template to build and deploy
- template: azure-templates/stages/angular-express-docker.yml@templates
parameters:
dockerRepoName: $(dockerRepoName)
# deploy to rancher
- template: azure-templates/stages/deploy-k8-npm.yml@templates
parameters:
helmReleaseName: $(helmReleaseName)
steps
property should not be put under stage
level. It's: stage=>job=>steps
So you can't place the steps
there when you're defining a multi-stage yaml pipeline.
1.steps
can be placed directly at first level for simple yaml pipeline (no stages):
trigger:
- master
pool:
vmImage: 'windows-latest'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: |
echo Add other tasks to build, test, and deploy your project.
displayName: 'Run a multi-line script'
2.It should be put under jobs level within multi-stage yaml pipeline:
stages:
- stage: build
displayName: Build
jobs:
- job: Build
pool:
name: xxx
steps:
- task: CmdLine@2
inputs:
script: |
echo Hello world
- stage: deploy
displayName: Release
jobs:
- job: Release
pool:
name: xxx
steps:
- task: CmdLine@2
inputs:
script: |
echo Hello world
According to your stages:
element, your pipeline will be recognized as a multi-stage pipeline that can be used to build and deploy. So you can't and shouldn't put steps
directly under stages:
.
Solution:
To resolve Unexpected value 'Steps'
, you should either remove the steps
or add them into one stage level:
stages:
- stage: First
displayName: FirstStage
jobs:
- job: FirstJob
pool:
name: xxx
steps:
- bash: 'curl -o aa.mp4 https://gpm.mmm.com/endpoints/Application/content/xyz/bb.mp4'
workingDirectory: '$(System.DefaultWorkingDirectory)/_hh_app/drop/app/dist/assets/images'
displayName: 'Download Assets'
# template to build and deploy
- template: azure-templates/stages/angular-express-docker.yml@templates
parameters:
dockerRepoName: $(dockerRepoName)
# deploy to rancher
- template: azure-templates/stages/deploy-k8-npm.yml@templates
parameters:
helmReleaseName: $(helmReleaseName)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With