GitLab: Unterschied zwischen den Versionen

aus www.kruedewagen.de, Homepage von Ralf und Judith Krüdewagen (Kruedewagen)
Zur Navigation springen Zur Suche springen
 
(32 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
 
<!--[[File:Gitlab_screenshot_dashboard.png|right|500px|thumb|The GitLab dashboard]]-->
 
<!--[[File:Gitlab_screenshot_dashboard.png|right|500px|thumb|The GitLab dashboard]]-->
This page describes '''GitLab''', which is a software for [[Git]] repository management and software development that can run on your own server.
+
This page describes '''GitLab''', which is a software for [[Git]] repository management and software development that can run on your own server. GitLab also offers a hosted online service at https://gitlab.com.
 
__TOC__
 
__TOC__
 
{{Clr}}
 
{{Clr}}
Zeile 24: Zeile 24:
 
*Notifications.
 
*Notifications.
 
*Visualization of commits, branches, etc.
 
*Visualization of commits, branches, etc.
 +
 +
 +
*[https://about.gitlab.com/blog/2020/03/30/new-features-to-core/ 18 GitLab features are moving to open source] (März 2020)
  
 
== Access to repositories ==
 
== Access to repositories ==
Zeile 148: Zeile 151:
 
  http://gitlab.example.com/help
 
  http://gitlab.example.com/help
  
==Issue Boards==
+
== Agile Project/Product Management ==
 +
*[https://www.youtube.com/watch?v=VR2r1TJCDew How to set up GitLab groups and projects to run multiple Agile teams with microservices]
 +
=== Issues ===
 +
*https://docs.gitlab.com/ee/user/project/issues/
 +
*Issue Templates
 +
**Defined within ''.gitlab/issue_templates/''
 +
**Exmaple for a "Bug" template ''Bug.md'':
 +
<syntaxhighlight lang="markdown">
 +
# Details
 +
 
 +
# Customer information
 +
* Client reported the bug:
 +
 
 +
# Workflow
 +
 
 +
Please mark the checks if the corresponding step is __finished__.
 +
 
 +
- [ ] Bug can be reproduced :frame_photo:
 +
- [ ] Shipment :cruise_ship:
 +
    - [ ] Yes, the feature can be shipped automatically (continuous delivery)
 +
    - [ ] No, we need to align date of shipment
 +
- [ ] Approved :vertical_traffic_light:
 +
 
 +
## Additional information
 +
* Effort Estimation (in PT): _please add estimated duration using a [quick action](https://gitlab.kruedewagen.de:9443/help/user/project/quick_actions)_
 +
* Is a date of shipment communicated to the client (yes|no)?
 +
  - If yes, which date:
 +
 
 +
/label ~"bug"
 +
</syntaxhighlight>
 +
*Story Points per [https://docs.gitlab.com/ce/user/project/issues/issue_weight.html Weight] (nur ab Starter)
 +
*[https://docs.gitlab.com/ee/user/project/time_tracking.html Time Tracking]
 +
*[https://docs.gitlab.com/ee/user/project/issues/crosslinking_issues.html Crosslinking Issues]
 +
#xxx
 +
https://gitlab.com/<username>/<projectname>/issues/<xxx>
 +
 
 +
===Issue Boards===
 +
Issue boards are controlled by labels. Board can be created by project/repo and also on group level.
 +
 
 
A feature board respective product backlog with a workflow for requirement engineering could look like:
 
A feature board respective product backlog with a workflow for requirement engineering could look like:
 
* backlog
 
* backlog
Zeile 164: Zeile 205:
 
[[Datei:Issue board part1.png|500px|miniatur|ohne|Feature Board Part 1]]
 
[[Datei:Issue board part1.png|500px|miniatur|ohne|Feature Board Part 1]]
 
[[Datei:Issue board part2.png|500px|miniatur|ohne|Feature Board Part 2]]
 
[[Datei:Issue board part2.png|500px|miniatur|ohne|Feature Board Part 2]]
 +
 +
=== EPICs ===
 +
*[https://about.gitlab.com/2018/08/23/epics-roadmap/ Seamless top-down and bottoms-up planning with epics and roadmap]
 +
*[https://about.gitlab.com/blog/2020/01/21/epics-three-features-accelerate-your-workflow/ 3 Major improvements to epics in GitLab 12.7]
 +
 +
=== User Story ===
 +
*[https://about.gitlab.com/blog/2020/03/27/how-we-utilize-user-stories-as-a-collaborative-design-tool/ Improving iteration and collaboration with user stories]
 +
 +
===See also===
 +
*https://docs.gitlab.com/ee/user/project/issue_board.html
 +
*[https://about.gitlab.com/2018/08/02/4-ways-to-use-gitlab-issue-boards/ 4 ways to use GitLab Issue Boards]
 +
 +
== Operations ==
 +
=== Incident Alerts ===
 +
*Alerts erstellen auch einen Issue mit dem Tag "incident".
 +
*"fingerprint" muss unique sein, sonst wird kein Alert/Issue erzeugt.
 +
*https://docs.gitlab.com/ce/operations/incident_management/
 +
*https://docs.gitlab.com/ce/operations/incident_management/generic_alerts.html
 +
**Beispiel
 +
<syntaxhighlight lang="json">
 +
curl --request POST \
 +
        --data '{"title": "Test Incident", "description": "Short description of the incident", "start_time": "2020-08-30T08:00:55Z", "service": "My little service", "monitoring_tool": "Icinga", "hosts": "server1", "severity": "high", "fingerprint": "0815a"}' \
 +
  --header "Authorization: Bearer <key>" \
 +
  --header "Content-Type: application/json" \
 +
  https://gitlab.example.com/group1/project1/alerts/notify.json
 +
</syntaxhighlight>
  
 
==Docker Registry ==
 
==Docker Registry ==
 
*Aufräumen:
 
*Aufräumen:
 
  gitlab-ctl registry-garbage-collect
 
  gitlab-ctl registry-garbage-collect
 +
 +
== Mattermost ==
 +
*[https://github.com/mattermost/mattermost-plugin-gitlab GitLab plugin for Mattermost]
  
 
== Literature and Tutorials ==
 
== Literature and Tutorials ==
Zeile 173: Zeile 243:
 
*[[c't]] 13/16 S.134
 
*[[c't]] 13/16 S.134
 
*[https://about.gitlab.com/2017/01/23/video-tutorial-idea-to-production-on-google-container-engine-gke/ Video Tutorial: Idea to Production on Google Container Engine (GKE)]
 
*[https://about.gitlab.com/2017/01/23/video-tutorial-idea-to-production-on-google-container-engine-gke/ Video Tutorial: Idea to Production on Google Container Engine (GKE)]
*Continuous Integration (CI) mit [[Docker]] und GitLab: siehe [[LM]] 01/18 S.58
+
*Continuous Integration (CI) mit [[Docker]] und GitLab: siehe [http://www.linux-magazin.de/ausgaben/2018/01/ci-mit-gitlab/ LM 01/18 S.58]
*GitLab CI/CD: siehe c't 25/17 S.88
+
*GitLab CI/CD: siehe [https://www.heise.de/ct/ausgabe/2017-25-GitLab-CI-CD-Mietserver-bauen-Software-3894126.html c't 25/17 S.88]
 +
*[https://www.heise.de/developer/meldung/GitLab-11-0-Auto-DevOps-Feature-fuer-alle-Nutzer-4090828.html GitLab 11.0: Auto-DevOps-Feature für alle Nutzer]
 +
*[https://www.heise.de/developer/meldung/GitLab-automatisiert-die-Integration-von-Kubernetes-4013141.html GitLab automatisiert die Integration von Kubernetes ]
 +
*Continuous Integration: GitLab-CI-Setup: siehe [https://www.heise.de/ix/heft/Bausatz-zur-Automatisierung-4117100.html iX 08/18 S.102]
 +
*GitLab für DevOps-Teams: siehe [[LM]] 04/19 S.22
 +
*GitLab CI und CD installieren und konfigurieren: siehe [https://www.heise.de/select/ix/2019/4/1553943972989985 iX 04/19 S.118]
 +
*[https://about.gitlab.com/blog/2020/05/28/using-gitlab-web-ide-gitlab-ci-cd/ How to make small changes using GitLab’s Web IDE]
  
 
== Tools ==
 
== Tools ==
Zeile 222: Zeile 298:
 
*http://www.badzilla.co.uk/openSUSE-12-3-Installation-of-GitLab-Nginx-Apache-and-Drupal-PHP
 
*http://www.badzilla.co.uk/openSUSE-12-3-Installation-of-GitLab-Nginx-Apache-and-Drupal-PHP
  
Continuous Integration:
+
Continuous Integration (CI/CD):
*[http://doc.gitlab.com/ci/ GitLab CI Doc]
+
*[https://about.gitlab.com/features/gitlab-ci-cd/ GitLab Continuous Integration & Deployment]
 +
*[https://docs.gitlab.com/ee/ci/quick_start/README.html GitLab CI Quick Start]
 +
*[https://about.gitlab.com/features/jenkins/ Jenkins Integration]
 +
*[https://about.gitlab.com/features/jira/ JIRA Integration]
 
*[https://about.gitlab.com/2015/08/19/quayio/ Continuous Integration of GitLab-Hosted Docker Projects with Quay.io] (gitlab.com)
 
*[https://about.gitlab.com/2015/08/19/quayio/ Continuous Integration of GitLab-Hosted Docker Projects with Quay.io] (gitlab.com)
*[https://www.gitlab.com/2015/12/14/getting-started-with-gitlab-and-gitlab-ci/ Getting Started With GitLab and GitLab CI]
 
 
*[http://www.pro-linux.de/artikel/2/1808/gitlab-continuous-integration.html GitLab Continuous Integration] (pro-linux.de)
 
*[http://www.pro-linux.de/artikel/2/1808/gitlab-continuous-integration.html GitLab Continuous Integration] (pro-linux.de)
 
*[https://about.gitlab.com/2018/04/24/getting-started-gitlab-ci-gcp/ Getting started with GitLab CI/CD and Google Cloud Platform] (GitLab)
 
*[https://about.gitlab.com/2018/04/24/getting-started-gitlab-ci-gcp/ Getting started with GitLab CI/CD and Google Cloud Platform] (GitLab)
 
*[https://entwickler.de/online/php/self-hosted-continuous-integration-php-579838010.html Continuous Integration für PHP Anwendungen mit GitLab], [https://www.youtube.com/watch?v=m35iG5v-rRw Video]
 
*[https://entwickler.de/online/php/self-hosted-continuous-integration-php-579838010.html Continuous Integration für PHP Anwendungen mit GitLab], [https://www.youtube.com/watch?v=m35iG5v-rRw Video]
 +
*[https://about.gitlab.com/2018/07/18/using-the-gitlab-ci-slash-cd-for-smart-home-configuration-management/ Using GitLab CI/CD for smart home configuration management]
 +
*[https://about.gitlab.com/2018/07/30/gitlab-workflow-with-jira-jenkins/ Demo: GitLab + Jira + Jenkins]
 +
*[https://about.gitlab.com/2019/07/01/using-ansible-and-gitlab-as-infrastructure-for-code/ How to use GitLab and Ansible to create infrastructure as code]
 +
*[https://about.gitlab.com/2019/07/12/guide-to-ci-cd-pipelines/ A quick guide to GitLab CI/CD pipelines]
 +
 +
Serverless / FaaS:
 +
*https://about.gitlab.com/2018/12/11/introducing-gitlab-serverless/
 +
*https://entwickler.de/online/agile/gitlab-serverless-angekuendigt-natives-faas-fuer-gitlab-579871325.html
 +
 +
Cloud:
 +
*[https://about.gitlab.com/blog/2019/11/18/gitops-prt-3/ How to deploy to any cloud using GitLab for GitOps]
  
 
Release Strategy:
 
Release Strategy:
Zeile 235: Zeile 324:
 
Agile Software Development:
 
Agile Software Development:
 
*[https://about.gitlab.com/2018/03/05/gitlab-for-agile-software-development/ How to use GitLab for Agile software development] (i.e. Issue Board = Product Backlog, Milestone = Sprint, etc.)
 
*[https://about.gitlab.com/2018/03/05/gitlab-for-agile-software-development/ How to use GitLab for Agile software development] (i.e. Issue Board = Product Backlog, Milestone = Sprint, etc.)
 +
 +
Markdown:
 +
*https://about.gitlab.com/2018/08/17/gitlab-markdown-tutorial/
  
 
== See also ==
 
== See also ==
 
*[[Git]]
 
*[[Git]]
 +
*My [https://gitlab.com/formwandler GitLab profile]
  
 
[[Category:Git]]
 
[[Category:Git]]

Aktuelle Version vom 30. August 2020, 11:49 Uhr

This page describes GitLab, which is a software for Git repository management and software development that can run on your own server. GitLab also offers a hosted online service at https://gitlab.com.


Overview

GitLab is Open Source and offers Git repository management, code reviews, issue tracking, activity feeds and wikis.

Features

Major GitLab features are depicted in this article on techdo.me.

Some highlights:

  • User management.
  • SSH key management for accessing a repo via SSH and mapping to GUI user.
  • Repository/project permissions (private, protected or public). Users and groups.
  • View commits.
  • Comments.
  • Issue tracking.
  • Markdown support.
  • Branches and tags can be created in GUI.
  • Merge requests. Code review.
  • New files can be created and in the GUI.
  • Files can be edited in the GUI.
  • A wiki per project (in separate Git repo).
  • Notifications.
  • Visualization of commits, branches, etc.


Access to repositories

The GitLab GUI always shows the links you need to use for accessing (cloning) the Git repositories either via HTTP or SSH.

Example URLs for project/repository:

HTTP access:

http://gitlab.example.com/group1/project1.git

SSH access on port 22:

git@gitlab.example.com/group1/project1.git
Note: The repo must be addressed with a absolute path (do not use ":" between hostname and pathname)

The corresponding clone commands are:

git clone http://gitlab.example.com/group1/project1.git
git clone ssh://git@gitlab.example.com/group1/project1.git

Notes:

  • For HTTP you need to authenticate with your GitLab user credentials, if it's not a public repo.
  • It's recommended using SSH for accessing the repositories with a Git client.
  • The SSH connect must go directly to the host GitLab has been installed on (no proxy in between).
  • For SSH you need to always login as user git. The user mapping will be made via your SSH key(s).
  • For SSH you need to authenticate with a SSH private key matching the public key you need to register in your GitLab user profile.
  • The SSH keys must be unique. You can't add a public key to multiple user profiles. The keys are added to ~git/.ssh/authorized_keys.
  • For SSH you need to take care using the correct SSH key, e.g. just add following to ~/.ssh/config:
Host gitlab.example.com
IdentityFile ~/.ssh/id_rsa_emptypass
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
  • For SSH you can check the general SSH access and authentication by just connecting to the server with a native SSH client. In addition, your GitLab user mapping will be responded by the server as e.g. Welcome to GitLab, Peter Pan!. A successful connect (using SSH port forwarding) looks like:
> ssh git@gitlab.example.com
X11 forwarding request failed on channel 0
PTY allocation request failed on channel 0
Welcome to GitLab, Peter Pan!
Connection to gitlab.example.com closed.

Operations

See Operations for info about installing and maintaining GitLab.

Docker

See hub.docker.com for running GitLab as Docker container.

Creating the container:

docker run --detach \
    --hostname gitlab.example.com \
    --publish 9443:9443 --publish 9080:9080 --publish 9022:22 \
    --name gitlab \
    --restart always \
    --volume /srv/gitlab/config:/etc/gitlab \
    --volume /srv/gitlab/logs:/var/log/gitlab \
    --volume /srv/gitlab/data:/var/opt/gitlab \
    gitlab/gitlab-ce:latest

GitLab configuration gitlab.rb:

external_url 'https://gitlab.example.com:9443'

nginx['ssl_certificate']= "/etc/gitlab/ssl/fullchain.pem"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/privkey.pem"

gitlab_rails['gitlab_shell_ssh_port'] = 9022

gitlab_rails['gitlab_email_from'] = 'gitlab@example.com'
gitlab_rails['gitlab_email_display_name'] = 'GitLab example.com'
gitlab_rails['gitlab_email_reply_to'] = 'gitlab@example.com'

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "mail.example.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "user"
gitlab_rails['smtp_password'] = "pass"
gitlab_rails['smtp_domain'] = "mail.example.com"
gitlab_rails['smtp_authentication'] = "plain"
gitlab_rails['smtp_enable_starttls_auto'] = true

Notes about running GitLab on a Docker host with Port 80, 443 and 22 already occupied:

  • GitLab must be configured to set the external ports like 9443 and/or 9080. Once you set "external_url 'https://gitlab.example.com:9443'", nginx will listen on port 9443.
  • Setting the SSH port
gitlab_rails['gitlab_shell_ssh_port'] = 9022
does only work when the port forwarding from Docker is e.g. 9022->22. 9022->9022 did not work for me.
  • All these HTTP/HTTPS and SSH configured are used as ports in the GitLab user interface, e.g. in the clone URL.
  • You can/should create virtual webservers on the Docker host serving port 443 and 80 and redirecting both the the external GitLab URL.
  • For TLS with Let's Encrypt see TLS.

Update:

docker stop gitlab
docker rm gitlab
docker pull gitlab/gitlab-ce:latest
docker run ...

Troubleshooting:

docker logs gitlab
docker exec -it gitlab bash

Ports:

Weblinks:

TLS


Help

The GitLab GUI has an excellent online help available at

http://gitlab.example.com/help

Agile Project/Product Management

Issues

# Details

# Customer information
* Client reported the bug:

# Workflow

Please mark the checks if the corresponding step is __finished__.

- [ ] Bug can be reproduced :frame_photo:
- [ ] Shipment :cruise_ship:
    - [ ] Yes, the feature can be shipped automatically (continuous delivery)
    - [ ] No, we need to align date of shipment 
- [ ] Approved :vertical_traffic_light:

## Additional information
* Effort Estimation (in PT): _please add estimated duration using a [quick action](https://gitlab.kruedewagen.de:9443/help/user/project/quick_actions)_
* Is a date of shipment communicated to the client (yes|no)?
  - If yes, which date:

/label ~"bug"
#xxx
https://gitlab.com/<username>/<projectname>/issues/<xxx>

Issue Boards

Issue boards are controlled by labels. Board can be created by project/repo and also on group level.

A feature board respective product backlog with a workflow for requirement engineering could look like:

  • backlog
  • new requirement
  • business analysis
  • technical analysis
  • ready for development
  • in progress
  • in qa
  • ready for production
  • on production
  • closed

This feature boards looks like following:

Feature Board Part 1
Feature Board Part 2

EPICs

User Story

See also

Operations

Incident Alerts

curl --request POST \
        --data '{"title": "Test Incident", "description": "Short description of the incident", "start_time": "2020-08-30T08:00:55Z", "service": "My little service", "monitoring_tool": "Icinga", "hosts": "server1", "severity": "high", "fingerprint": "0815a"}' \
  --header "Authorization: Bearer <key>" \
  --header "Content-Type: application/json" \
  https://gitlab.example.com/group1/project1/alerts/notify.json

Docker Registry

  • Aufräumen:
gitlab-ctl registry-garbage-collect

Mattermost

Literature and Tutorials

Tools

  • RequestBin
    • Testen von HTTP Requests, z.B. für den Empfang von Webhooks bei Git/GitLab.
    • Siehe "GitLab Cookbook" S.113 - Using webhooks.
    • RequestBin gives you a URL that will collect requests made to it and let you inspect them in a human-friendly way. Use RequestBin to see what your HTTP client is sending or to inspect and debug webhook requests.
  • Postman
    • REST Client, Testen von APIs
    • Chrome Browser Extension
    • Sendet HTTP Request zu einem Server, auch mit Parameter/Value Variablen von simulierten Formularen
    • Siehe "GitLab Cookbook" S.121 - Managing your projects via the API.

Weblinks

GitLab official sites:

Additional components:

Webcasts:

Other resources:

Using under openSUSE:

Continuous Integration (CI/CD):

Serverless / FaaS:

Cloud:

Release Strategy:

Agile Software Development:

Markdown:

See also