Using Cloud Source Repositories for Version Control in Looker

  • 22 June 2022
  • 0 replies
  • 381 views

Looker will not be updating this content, nor guarantees that everything is up-to-date. 

This article is meant to be used in conjunction with the Looker documentation page Setting Up and Testing a Git Connection, which describes how to integrate Looker with Git, including connecting to Git using SSH. This article highlights the steps for setting up version control with an SSH key from Cloud Source Repositories.
 

IMPORTANT: The user who owns the SSH key must be a member of the Cloud Source Repositories repository and must have write access on the repository. To be allowed such access, the user must be the owner of the repository, have explicit write access granted to them, or be a member of a group that has write permissions on the repository.


You can follow along with the instructions in the "Connecting to Git Using SSH" section of the Setting Up and Testing a Git Connection documentation page. As you read through and implement the instructions in the SSH section of the documentation page, refer to this article for expanded instructions and to view the Cloud Source Repositories screenshots.

  1. In Cloud Source Repositories, get the SSH URL for your repository. The format should look similar to this:
    ssh://username@example.com@source.developers.google.com:2022/p/<project-id>/r/<repository-name>
    Find the SSH URL by clicking Clone and then Setup SSH key in your repo:

     

  2. Cloud Source Repositories shows you the command to clone the repo. Copy the URL portion that begins with ssh:

     

  3. Open your project in Looker, and then do one of the following:
    • For a new project, click the Configure Git button.
    • If you want to change the setup for an existing project, click on the Git menu and select Project Settings; then click the Reset Git Connection button from the Project Settings page.
      Starting in Looker 7.12, the Reset Git Connection button is located on the Configuration tab of the Project Settings page in the new IDE. Navigate to the Project Settings page by clicking the Settings icon from the navigation bar.
  4. Enter the SSH URL for your Cloud Source Repositories repo in the Repository URL field for your LookML project configuration.
  5. Looker will detect your Git provider and display an SSH deploy key for your repo. (If Looker does not successfully detect your Git provider, you will be asked to choose one from a drop-down. Choose Cloud Source Repositories.) Select the entire SSH deploy key and copy it to your clipboard.

     

  6. In Cloud Source Repositories, click on the Register the SSH key link:
    This opens the Register SSH Key page.
  7. Add a name for the SSH deploy key. You can choose any name, but you might want to include Looker and your project title to keep track of the deploy key in the future.
     

     

  8. Paste the SSH deploy key you copied from Looker.
  9. Click Register to save the SSH key.
  10. Go back to your Looker window and click Test and Finalize Setup in the Configure Git screen.

Git is now configured for your LookML project. From here you can validate your LookML, and then create your initial commit and deploy to production to make your project available in Production Mode. You can also:


This topic has been closed for comments