This project demonstrates how to use the include configuration in .cnb.yml to manage environment variables during build and deployment processes.
The project contains two main configuration files:
Main configuration file that includes:
Secondary configuration file that defines:
The project uses the following environment variables:
KEY_A: AKEY_B: BKEY_C: CKEY_X: XKEY_Y: YThe build process performs the following operations:
env | grep KEY_ command to display all environment variables starting with KEY_The deployment process performs the following operations:
env | grep KEY_ command to display all environment variables starting with KEY_# .cnb.yml
include:
- ./t.yml
.deploy-env:
KEY_X: X
KEY_Y: Y
main:
push:
build:
env:
KEY_C: C
# t.yml
main:
push:
build:
env:
KEY_A: A
KEY_B: B
stages:
- env |grep KEY_
deploy:
env: !reference [.deploy-env]
stages:
- env |grep KEY_
!reference directiveKEY_ for easy filtering and management