Hi I was working in DevOps pipeline for AKS application deployment. I was not able to find the exact path of my deployment.yml and service.yml
My azure-pipeline.yml code is the following
trigger:
- master
resources:
- repo: self
variables:
imageRepo: inboundapi
tag: '$(Build.BuildId)'
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
displayName: Build an image
inputs:
containerRegistry: 'msdacrconnect'
repository: '$(imageRepo)'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
tags: |
$(tag)
latest
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)/s/manifests'
artifact: 'manifests'
publishLocation: 'pipeline'
- stage: Deploy
displayName: Deploy image
dependsOn: Build
variables:
acrsecret: aksacrsecret
jobs:
- job: Deploy
displayName: Deploy to AKS
pool:
vmImage: ubuntu-latest
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'manifests'
targetPath: '$(Pipeline.Workspace)/manifests'
- task: KubernetesManifest@0
inputs:
action: 'createSecret'
kubernetesServiceConnection: 'aksclustersvccon'
namespace: 'inboundapiapp'
secretType: 'dockerRegistry'
secretName: '$(acrsecret)'
dockerRegistryEndpoint: 'msdacrconnect'
- task: KubernetesManifest@0
inputs:
action: 'deploy'
kubernetesServiceConnection: 'aksclustersvccon'
namespace: 'default'
manifests: |
$(Pipeline.Workspace)/manifests/deployment.yml
$(Pipeline.Workspace)/manifests/service.yml
It was showing me the following error
##[error]No manifest file(s) matching /home/vsts/work/1/s/'/home/vsts/work/1/deployment.yml','/home/vsts/work/1/service.yml' was found.
suddenly I got this post and checked with the following yml. It's work and I found my artifact path.
trigger:
- master
resources:
- repo: self
variables:
imageRepo: inboundapi
tag: '$(Build.BuildId)'
stages:
- stage: Deploy
displayName: Deploy image
variables:
acrsecret: aksacrsecret
jobs:
- job: Deploy
displayName: Deploy to AKS
pool:
vmImage: ubuntu-latest
steps:
- task: CmdLine@2
inputs:
script: |
echo "$(Pipeline.Workspace)"
tree $(Pipeline.Workspace)