In the gooddata.yml, can the source_dir be varied ...
# gd-beginners
p
In the gooddata.yml, can the source_dir be varied by profile. Something like below. If not, what is a good workaround?
Copy code
profiles:
  default_profile: dev
  dev:
    host: <https://parentcompany.cloud.gooddata.com/>
    token: $GOODDATA_API_TOKEN
    workspace_id: REPLACE_ME_730b50f8-8a93-4723-a872-64dca815a616
    data_source_id: REPLACE_ME_c2066bb5-bb14-419a-8172-239a380ffb49
    source_dir: src/sandbox/
  demo:
    host: <https://parentcompany.cloud.gooddata.com/>
    token: $GOODDATA_API_TOKEN
    workspace_id: REPLACE_ME_730b50f8-8a93-4723-a872-64dca815a616
    data_source_id: REPLACE_ME_c2066bb5-bb14-419a-8172-239a380ffb49
    source_dir: src/demo/
  organization_a:
    host: <https://parentcompany.cloud.gooddata.com/>
    token: $GOODDATA_API_TOKEN
    workspace_id: REPLACE_ME_730b50f8-8a93-4723-a872-64dca815a616
    data_source_id: REPLACE_ME_c2066bb5-bb14-419a-8172-239a380ffb49
    source_dir: src/organization_a/
  organization_b:
    host: <https://parentcompany.cloud.gooddata.com/>
    token: $GOODDATA_API_TOKEN
    workspace_id: REPLACE_ME_730b50f8-8a93-4723-a872-64dca815a616
    data_source_id: REPLACE_ME_c2066bb5-bb14-419a-8172-239a380ffb49
    source_dir: src/organization_b/
⁉️ 1
i
Hey Patrick, May I know what exactly are you trying to achieve with gooddata.yaml, please? Are you working with our SDK or maybe with our VS Code Extension?
p
yes, I am working with the CLI for context.
✔️ 1
having only one source_dir makes switching more difficult
Or we end up with a gooddata.yml for each workspace in our repo.
Trying to consolidate multiple gooddata.yml files into one.
Can you help me?
i
Thank you for the confirmation, let me check what are our options here.
Hi @Andy - could you or somebody from your team can help Patrick, please?
a
Hi Patrick. At the moment, a single gooddata.yaml file is designed to work with a single “code” workspace. Profiles are defining different deployment targets (e.g. dev, staging etc.). To work with multiple code workspaces, you’ll need multiple gooddata.yaml files. I realize this is suboptimal, as you might need to copy profiles this way. We have plans to introduce multiworkspace projects in future, but I don’t have a timeline for this feature as of now
🙌 1
p
Then 2 follow up questions, the $GOODDATA_API_TOKEN templating is it pulled from environment variables or just the .env file? And, could I variablize or use my own $SOMERANDOMTHING anywhere in the yml or only in the template node?
a
It is reading the variables from the environment as well. You can use any variable name, not just $GOODDATA_API_TOKEN. This way you can have different tokens for different profiles/files. But, if I remember it right, only for the token field. I’ll double check on that and will get back toy you once I’m in office tomorrow ;)
Hi @Patrick Bierkortte. I’ve double checked the code and you can actually use env variables for all properties within a profile: • token • host • workspace_id • data_source_id
🙌 1