Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 1.61 KB

gitlab.md

File metadata and controls

65 lines (41 loc) · 1.61 KB

GitLab

https://gitlab.com

GitLab is the number 2 hosting provider for Git repos after GitHub

It has good feature parity with GitHub.com, although less 3rd party CI/CD integrations as everybody integrates to GitHub first .

GitLab CLI

Install doc

On Mac using Homebrew:

brew install glab
glab --help

Various GitLab CLI scripts are in HariSekhon/DevOps-Bash-tools repo.

Script to download latest binary from GitLab to /usr/local/bin or $HOME/bin:

git clone https://github.com/HariSekhon/DevOps-Bash-tools bash-tools
cd bash-tools
install/install_gitlab_cli.sh

GitLab CLI and API auth

For the glab CLI above and the gitlab_api.sh script in the DevOps-Bash-tools repo, create a Personal Access Token here:

GitLab -> Preferences -> Access Tokens

The add this to your shell / Bash profile:

export GITLAB_TOKEN=...

Gitlab CLI config can be found here:

 ~/.config/glab-cli/config.yml

GitLab CI/CD

Create a .gitlab-ci.yml into the root directory of your git repo, then git push to GitLab.

Template to get you started:

.gitlab-ci.yml

GitLab Official CI/CD Library

GitLab CI Library

Partial port from private Knowledge Base page 2012+