简体   繁体   English

我如何在单个管道 YAML 上运行两个清单?

[英]How can i run two manifests a single pipeline YAML?

i have a pipeline close with this one:我有一个与此关闭的管道:

trigger:
- master

variables:
  imageName: 'gosample'
  registry: 'kubreg.azurecr.io'

stages:
- stage: build
  jobs:
  - job: 'BuildAndPush'
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - task: Docker@2
      inputs:
        containerRegistry: 'ACR'
        repository: '$(imageName)'
        command: 'buildAndPush'
        Dockerfile: '**/Dockerfile'
    - task: PublishPipelineArtifact@0
      inputs:
        artifactName: 'manifests'
        targetPath: 'manifests'

- stage: deploy
  jobs:
  - deployment: 'DeployToK8S'
    pool:
      vmImage: 'ubuntu-latest'
    environment: dev
    strategy:
      runOnce:
        deploy:
          steps:
            - task: DownloadPipelineArtifact@1
              inputs:
                buildType: 'current'
                artifactName: 'manifests'
                targetPath: '$(System.ArtifactsDirectory)/manifests'
            - task: KubernetesManifest@0
              inputs:
                action: 'deploy'
                kubernetesServiceConnection: 'dev-kub-gosample-1558821689026'
                namespace: 'gosample'
                manifests: '$(System.ArtifactsDirectory)/manifests/deploy.yaml'
                containers: '$(registry)/$(imageName):$(Build.BuildId)'

And i want pass two manifests inside the deploy stage, how i can do?我想在部署阶段传递两个清单,我该怎么做?

I tried to pass something like:我试图通过类似的东西:

manifests: '$(System.ArtifactsDirectory)/manifests/deploy.yaml','$(System.ArtifactsDirectory)/manifest/ingress-nginx.yaml'

But Don't work and i really dont have idea how to do this.但是不要工作,我真的不知道该怎么做。

You can list multiple files by using a multiline string, as documented .您可以使用多行字符串列出多个文件, 如 documented 所示

task: KubernetesManifest@0
inputs:
  manifests: |
    manifests/deployment.yml
    manifests/service.yml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不同的 kubernetes 清单中重用通用配置? - How can I reuse common configuration across different kubernetes manifests? kube-apiserver 编辑 /etc/kubernetes/manifests/kube-apiserver.yaml 后如何重启 - how does kube-apiserver restart after editing /etc/kubernetes/manifests/kube-apiserver.yaml 如何将最新的构建 ID/编号/标签打印到 azure kubernetes 部署 deploy.yaml 文件 ZB76E9A58AF9AAAD680197 - How to print latest build id/number/tag into azure kubernetes deployment deploy.yaml file for kubernetes manifests 如何使用单个计算机作为主服务器和节点运行Kubernetes集群? - How can I run a Kubernetes cluster with a single machine as a master and node? 如何运行两个在kubernetes上的同一端口上侦听的容器? - How can I run two containers that listen on the same port on kubernetes? 无法使用 JKube maven 插件生成 Kubernetes 清单 yaml 文件 - Unable to generate Kubernetes manifests yaml files using JKube maven plugin 如何对 Kubernetes 中的清单执行策略? - How to enforce policies for manifests in Kubernetes? 如何在 YAML 中表示授权不记名令牌 - How can I represent authorization bearer token in YAML 如何在一个 yaml 文件中提供多个秘密? - how can I provide multipe secrets in one yaml file? 如何使用纯python创建kubernetes yaml文件 - How can I create kubernetes yaml file using pure python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM