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.
- In Cloud Source Repositories, get the SSH URL for your repository. The format should look similar to this:
ssh://firstname.lastname@example.org@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:
- Cloud Source Repositories shows you the command to clone the repo. Copy the URL portion that begins with
- 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.
- Enter the SSH URL for your Cloud Source Repositories repo in the Repository URL field for your LookML project configuration.
- 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.
- In Cloud Source Repositories, click on the Register the SSH key link: This opens the Register SSH Key page.
- Add a name for the SSH deploy key. You can choose any name, but you might want to include
Lookerand your project title to keep track of the deploy key in the future.
- Paste the SSH deploy key you copied from Looker.
- Click Register to save the SSH key.
- 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:
- Use the Git menu to access the Git commands.
- Use the Git menu to test your Git connection.
- If you are a Looker admin, go to the Project Settings page to require LookML validation and to configure Git integration options.