how can i set a constant in lookml (model + a few views) via git's ci/cd (or any other solution for dev/prod stuff)

68 views Asked by At

I've got two databases in google bigquery: company.prod.db and company.stg.db I want to have a dashboard that my stakeholders can see the prod data, while I edit stuff in the dev side. So my lookml dashboards can pull data, and I can even update the data it pulls by manually changing the lookml files.

I've already enabled the advanced deploy, and can deploy from my personal branch, or a collaborative team branch to the main branch. But I'd like to be able to automatically update databases when I changed branches.

1

There are 1 answers

0
Fabio Beltramini On

Although this is not a CI/CD based solution, you may find the "if dev" conditional SQL helpful here:

https://cloud.google.com/looker/docs/derived-tables#working_faster_in_development_mode

Here's another example that also works in user attributes:

https://discourse.getdbt.com/t/looker-user-attributes-and-if-dev-to-auto-switch-between-dev-prod-schemas/54