cf带清单和变量替换的v3-push

问题描述 投票:0回答:1

我有一个v3应用程序,我想将其部署到2个不同的环境中。应用程序名称和某些定义因环境而异,但清单的结构相同。例如:

# manifest_test.yml
applications:
- name: AppTest
  processes:
    - type: web
      command: start-web.sh
      instances: 1
    - type: worker
      command: start-worker.sh
      instances: 1

# manifest_prod.yml
applications:
- name: AppProd
  processes:
    - type: web
      command: start-web.sh
      instances: 3
    - type: worker
      command: start-worker.sh
      instances: 5

不是只保留变量的微小更改,而没有保留重复的清单,而是要在variable substitution中使用单个清单。所以我创建了这样的东西:

# manifest.yml
- name: App((env))
  processes:
    - type: web
      command: start-web.sh
      instances: ((web_instances))
    - type: worker
      command: start-worker.sh
      instances: ((worker_instances))

但是,似乎cf v3-apply-manifest没有提供替换变量的选项(如cf push那样。

有没有解决的办法,还是我必须针对每个环境继续使用单独的清单?

cloudfoundry cf-cli
1个回答
0
投票

请尝试使用cf v7 cli beta版本之一。我没有对其进行测试,但是cf7 push -h的输出具有使用--vars--vars-file的标志。它还应使用v3 API,以便支持滚动部署之类的功能。

对于它的价值,如果您想使用CAPI v3功能,则可能应该使用cf7 beta版本。这将为您提供对CAPI v3的最新和最大支持。

希望有帮助!

© www.soinside.com 2019 - 2024. All rights reserved.