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

我有一个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一样)。

有什么办法解决这个问题,还是必须针对每个环境继续使用单独的清单?

wurui126 回答:带有清单和变量替换的cf v3-push

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

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

希望有帮助!

本文链接:https://www.f2er.com/3108885.html

大家都在问