My project has multiple environment variables. Different parts of the pipeline require different subsets of these.
I create the variables and make a table like this:
timestamp=01-02-03T04:05
version=1.2.3
table='
VAR_NAME DJANGO_ENV K8S_ENV
timestamp ✅ ✅
version ✅ ⛔️
'
Now I would like to populate DJANGO_ENV
and K8S_ENV
:
DJANGO_ENV="timestamp=01-02-03T04:05 version=1.2.3"
K8S_ENV="timestamp=01-02-03T04:05"
... so I can run $K8S_ENV create_k8s_infra
How to do it?
(Note: I'm answering my own question in case the code is useful to someone)