GitLab Tutorials

Back to SIG Tooling & Set Up Tutorials

# Author: RJ Sheperd

# Date: 2023-04-12

GitLab Developer Setup

1. In your browser, visit SIG's GitLab:

SIG's GitLab

2. Use your SIG email address `@sig-gis.com` to sign up for an account.

3. Set up 2-Factor Authentication using your mobile device. For instance, you can use Google Authenticator:

Android

iOS

4. In your terminal, Create a new SSH Private/Public Key:

ssh-keygen -t ed25519 -C "@sig-gis.com"

This will prompt you where to save it. Keep the defaults (~/.ssh/id_ed25519). You may optionally set a password.

5. Add your PUBLIC key to your GitLab User GitLab SSH Keys:

GitLab SSH Keys

cat ~/.ssh/id_ed25519.pub

6. Add the following to your `~/.ssh/config` file (NOTE: Replace with your SIG username):

# ~/.ssh/config
Host 1.
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_ed25519
  ForwardAgent yes
  User 

Host gitlab.sig-gis.com
  Hostname 10.1.30.118

7. Connect to the VPN. Ask IT for your VPN access credentials.

8. Verify that you can connect to GitLab:

ssh -T git@gitlab.sig-gis.com
# Should return:
# Welcome to GitLab, @!

9. Go forth and code!

Set up GitLab Bot in Mattermost

If you would like GitLab to automatically post notifications to Mattermost whenever MRs are opened or merged, you can issue the following commands from within the Mattermost channel that should receive these notifications:

NOTE: Once one Mattermost user has done this, the notifications will appear for all members of that channel.

1. Set up a subscription to a SIG Gitlab repo inside of Mattermost:

/gitlab subscriptions add sig-gis/

2. This will prompt you to add a webhook. Do so using the GitLab web interface.

3. Copy the name of your new webhook from your browser and use it in the following command within Mattermost:

/gitlab webhook add 

4. Profit! Now you no longer need to manually type when a MR is opened or merged.