VSTS 自动为我创建了一个 yaml 管道。它在步骤 PublishPipelineArtifact 失败。
我不熟悉 yaml 语法。
下面是自动生成的 yaml 的摘录。2个步骤谈论清单。但是我的 Visual Studio 项目没有任何清单文件或目录,并且 VSTS 没有生成任何 Deployment.yml 或 service.yml。我不知道为什么它会失败,以及为什么这样的 yaml 是用不存在的依赖关系生成的。(如果我使用图形标准方式创建管道(不要求 yaml 管道),它不会失败并且不会生成清单部署步骤)。
- stage: Build
displayName: Build stage
jobs:
- job: Build
displayName: Build
pool:
name: "AWS Linux agents pool"
steps:
- checkout: Self
- checkout: Shared
path: s/File.Pod/Shared.Lib
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
- upload: manifests
artifact: manifests
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
jobs:
- deployment: Deploy
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
displayName: Deploy
pool:
name: "AWS Linux agents pool"
environment: 'FilePod-1617.development'
strategy:
runOnce:
deploy:
steps:
- task: KubernetesManifest@0
displayName: Create imagePullSecret
inputs:
action: createSecret
secretName: $(imagePullSecret)
dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
- task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster
inputs:
action: deploy
manifests: |
$(Pipeline.Workspace)/manifests/deployment.yml
$(Pipeline.Workspace)/manifests/service.yml
imagePullSecrets: |
$(imagePullSecret)
containers: |
$(containerRegistry)/$(imageRepository):$(tag)
我是否需要在 DockerFile 中的某个地方要求将其复制到某个地方