假设我有BOSH部署
name: some-name
director_uuid: some-uuid
releases:
compilation:
....
resource_pools:
...
networks:
...
jobs:
- name: deployment_name
instances: 1
templates:
resource_pool: ...
networks: ..
my_prop: "<%= ENV['MY_ENV_VAR'] %>"
如何注入多行MY_ENV_VAR值,以便在目标部署中正确呈现格式(换行符)?
使用my_prop的版本在这样的引擎下使用它
<%= p('my_prop') %>
答案 0 :(得分:1)
您可以使用YAML literal_block
功能|
[1]
name: some-name
director_uuid: some-uuid
releases:
compilation:
....
resource_pools:
...
networks:
...
jobs:
- name: deployment_name
instances: 1
templates:
resource_pool: ...
networks: ..
my_prop: |
"<%= ENV['MY_ENV_VAR'] %>"