Question

Can two LookML Projects use the same git repo?

  • 5 April 2019
  • 4 replies
  • 336 views

Can two LookML Projects use the same git repository?


4 replies

Userlevel 3

Hi Melissa,


Congrats on your first post!


Yes it is possible to point two projects to the same git repository. I’m interested in hearing why you’re looking into this, however. We see some customers use this setup when they’re trying to sync LookML across multiple Looker environments. You can read more about that here.


Outside of that use case, I cannot think of other reasons to point two projects at a single repo. Can you elaborate on what you’re looking to do?


Cheers,

Jesse

Hi Jesse,


Is it possible to have one repository for multiple instances, but every instance would connect to different database (different connection name in .model file)? Something like every instance would have its own .model file?


Cheers,

Kornel

Userlevel 2

Hello Kornel,


That’s exactly what we do. Essentially, we have many instances (spoke-and-gear style). Each instance has a skeleton project containing the following files:



  • instance.model

  • manifest.lkml


And a folder called,



  • instance/


Inside the instance.model we have something like,


connection: "this_instances_connection"

include: "//base_project/*.view.lkml"
include: "/instance/*.view"

The base_project is a local dependency which contains all of our LookML. The instance/ contains anything which is specific to this instance.


Insinde the manifest.lkml we have,


project_name: "this_instance_name"

local_dependency: {
project: "base_project"
}

This allows us to have one copy of our LookML for all of our instances, while having the ability to add code to this specific instance.


The process still confuses me a bit, so hopefully I’ve not typed anything wrong above. YMMV.


Helpful links,



Kind regards,

–Thomas

Hi @thomas_brittain , thank you for your post, I’ve run into this issue and support was unable to help me come up with a solution. I wanted to clarify how you’ve set up your projects:

  1. Each instance has a base project. This base project I assume is the same across instances, and share the same Git repo? Does the base project have a model?
  2. Each instance has a skeleton project that has `local_dependency` to the base project above. Do the skeleton projects in different instances also share the same repo?

Thanks,

Daphne

Reply