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中的某处要求复制它某处