GitLab🔗
=this.img
= ("> " + this.desc-short)
Item | References |
---|---|
External Links | = ("[Website](" + this.url + ")") , = ("[Documentation](" + this.docs + ")") |
GitLab docs | GL Markdown |
Topics | Agile |
Related | =(join(this.related, ", ")) |
Issues, Boards, Project Management🔗
See also GitLab: Agile
- Issues
- Tasks (type of Work Items)
- Description templates
- By sending an email: requires incoming email
- From URL: pre-filled values
> [!idea] #idea/cit Could be used to import e-mails (TopDesk calls, customer problems, …) into GitLab as issues
Markdown/HTML🔗
-
open link in new tab (
target="_blank"
) is unsafe, use instead, see GitLab Documentation1
<a href="url" target="_blank" rel="noopener noreferrer"></a>
Web Interface🔗
- Quick Actions: text-based shortcuts for common actions
- gitlab-svgs: GitLab icons ^8b2ea8
- GitLab logos
Snippets🔗
GitLab documentation: Snippets
Projects🔗
Authentication🔗
Access Tokens🔗
There is a variety of different access tokens available in GitLab: groups, impersonation, projects, … and each can be fine-grained, setting a role, permissions and an expiry date.
For example, to give read access to a project an access token with role Reporter
(Guest
can be insufficient) and permissions read_repository
can be used. Navigate to the project and select Access Tokens
from the settings menu.
- Personal
- Project
> Use a project access token to authenticate:
>
> - With the GitLab API.
> - With Git, when using HTTP Basic Authentication, use:
> - Any non-blank value as a username.
> - The project access token as the password.
> - Group
- API: personal/project/group tokens
Automation and CI/CD🔗
By default .gitlab-ci.yml
- CI/CD YAML syntax reference
- GitLab CI/CD variables | predefined variables
- GitLab CI/CD for external repositories
apparently it is possible to connect repositories, e.g. from Github, and use GitLab CI/CD - Git submodules
- Schedule pipelines
- GitLab development with Vagrant
- Migrate from GitHub
Example YAML config
1 2 3 4 5 6 7 8 9 10 |
|
References
- To Be Continuous: GitLab CI templates
> to be continuous proposes a set of GitLab CI templates developed and maintained by DevOps and technology experts to build state-of-the-art CI/CD pipelines in minutes.
Stages🔗
pages
: special and activated for projects where GitLab Pages feature is enabled. Afterbuild
stage artifacts (defaultpublic/
) are deployed to configured destination
Script🔗
Custom commands to be executed in script
section
- before_script: run before every command in
script
section. Per stage or globally defined.
Artifacts🔗
Projects settings
- maximum artifact size
- expiration and keeping artifacts of last successful pipeline
If deleting artifacts through the webinterface doesn’t reduce the storage consumption, you can use an API call to delete project artifacts12
1 |
|
Docker🔗
Configure runner in runner config.toml
(see explanations below)
1 2 3 |
|
Register runner with a config template (directory with this file has to be mounted as Docker volume)
1 |
|
- Docker images
- Triggers and connecting pipelines (e.g. from another project’s pipeline)
- GitLab documentation: Triggers
- GitLab documentation: Pipeline Triggers
- GitLab documentation: Downstream pipelines: multi-project pipelines, parent-child pipelines
To test a pipeline job from a .gitlab-ci.yaml
file
1 2 3 |
|
Webhooks🔗
There’s a number of events to chose from as webhooks, for example Wiki page events
, that can be used e.g. to trigger a pipeline (in a different project). The GitLab webinterface discourages the use of Webhooks, suggesting Integrations instead.
Wiki page events
: âš only triggers when changes are done through the GitLab Wiki webinterface, not when pushing changes to the GitLab Wiki repository.
Auto DevOps🔗
https://docs.gitlab.com/ee/topics/autodevops/index.md
Server🔗
- Install GitLab
Debian package didn’t work for me, but their GitLab installation script did,
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
- Configuring Omnibus GitLab
- Security
- Database: only PostgreSQL
Console🔗
Fixing requirement of both MFA and password some users experience
1 2 3 4 |
|
LDAP🔗
See also LWP: GitLab > LDAP
https://docs.gitlab.com/ee/administration/auth/ldap/index.html
Rake tasks🔗
https://docs.gitlab.com/ee/raketasks/
-
1 2
sudo gitlab-rake gitlab:ldap:check # test bind_dn and pw, print 100 users as sample sudo gitlab-rake gitlab:ldap:check[5] # print only 5 users
- reset password: Rake Task, Rails console
- Server Hooks @GitLab Documentation
- Repository Storage Types > Translate Hashed Storage Paths
- with admin rights: go to Admin Area > project > Gitaly relative path
- …
Enterprise Edition (EE)🔗
Convert Community Edition to Enterprise Edition
Trial License
Activate
Rails Console🔗
-
look up user info
```ruby
u = User.find_by_username(‘someuser’)
pp u.attributessend test email to user🔗
Notify.test_email(u.email, “Test email for #{u.name}”, ‘Test email’).deliver_now
```
- 2FA, MFA
1 2
User.find_each(&:disable_two_factor!) # disable for all users (reset if enforced by admin settings) User.where(username: "username_goes_here").each(&:disable_two_factor!) # disable for certain user
-
(Re-)Set password ^1b2997
1 2 3 4 5 6
new_password = 'examplepassword' user.password = new_password user.password_confirmation = new_password user.send_only_admin_changed_your_password_notification! user.save! # root: usually UID 1, else search for root
Or use a Rails Runner to execute commands non-interactively
1 |
|
Rake Tasks🔗
Reset user password ^8cee12
1 |
|
Elasticsearch (EE)🔗
https://docs.gitlab.com/ee/integration/advanced_search/elasticsearch.html
Service Desk🔗
https://docs.gitlab.com/ee/user/project/service_desk/index.html
Wiki🔗
- GitLab group wikis (Premium)
- Automatically create TOC:
[[_TOC_]]
- does nest
- currently not possible to hide/exclude something from the TOC
- Link an external Wiki
GitLab Pages🔗
Examples and References
- GL Website: Pages
- GL Documentation: Pages
- Getting Started
- static site generators: Gatsby, Jekyll, Hugo, Middleman, Harp, Hexo, or Brunch
- MkDocs: my notes
- Examples
- https://gitlab.gnome.org/Infrastructure/gtk-web
- Artifact size: if the artifact is too large to be deployed there are two settings. First the maximum artifact size can be set per instance, group and project in the admin settings. Second the maximum size for a page can be set in the admin settings under Preferences > Pages
References🔗
-
https://stackoverflow.com/a/73820571 (2024-03-08) ↩
-
https://benlobaugh.medium.com/how-to-clean-up-gitlab-artifacts-c7ce34c70213 (2024-03-08) ↩