AzureDevOps Pipeline CICD No Objects Found



我使用Azure DevOps进行CI/CD。从上周开始,我对我的管道没有做任何事情。我使用。net6 ACR和AKS。今天我发布了一个版本,Kubectl apply任务上的管道失败了。这是部署。和错误消息清单和部署已经100%在工件中了。下面是apply阶段

中工件的路径文件路径:

(System.DefaultWorkingDirectory)/美元_Service.Payment/表现/qa/deployment.yml

apiVersion: apps/v1
kind: Deployment
metadata:
name: payment-service-deployment
spec:
selector:
matchLabels:
app: payment-service
template:
metadata:
labels:
app: payment-service
spec:
containers:
- name: payment-service
image: service.azurecr.io/paymentservice
resources:
limits:
memory: "128Mi"
cpu: "200m"
ports:
- containerPort: 80

Azure错误:

2022-12-13T10:51:29.5634198Z [command]/opt/hostdtoolcache/kubectl/1.7.0/x64/kubectl apply -n qa -f/home/vss/work/r1/a/_Service.Payment/manifest/qa/deploy .yml- o json2022-12-13T10:51:29.7227832Z错误:没有对象传递给应用2022-12-13 t10:51:29 . 7317807z# #[error]error: no objects passed to apply2022 - 12 - 13 t10:51:29.7327285z commandOutput进程'/opt/hostdtoolcache/kubectl/1.7.0/x64/kubectl'失败,退出码为1

我在删除这些行后解决了这个问题:

- task: CopyFiles@1
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)/Manifests'
Contents: '**'
TargetFolder: '$(System.DefaultWorkingDirectory)/Manifests'
OverWrite: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(System.DefaultWorkingDirectory)/Manifests'
ArtifactName: 'Manifests'
publishLocation: 'Container'

并加上这些:

- upload: Manifests
artifact: Manifests
displayName: 'Upload Artifact: Manifests'

这是非常奇怪的,为什么PublishBuildArtifacts@1使yml文件在manifest像目录,但第二个只是上传使它们像文件。所以问题是文件就像目录。

相关内容

  • 没有找到相关文章

最新更新