tech:notes_gitlab
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:notes_gitlab [2025/11/11 20:58] – Jean-Baptiste | tech:notes_gitlab [2026/06/09 11:44] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Gitlab | ||
| + | |||
| + | Voir : | ||
| + | * [[Notes gitlab-ci pipeline|Notes Gitlab-CI]] | ||
| + | * https:// | ||
| + | * CIS GitLab Benchmark | ||
| + | |||
| + | Voir aussi : | ||
| + | * [[Notes GOGS forge git serveur github like| Gogs]] | ||
| + | * Gitea | ||
| + | * GitPrep | ||
| + | * gitweb | ||
| + | * ArgoCD | ||
| + | * Tekton | ||
| + | |||
| + | |||
| + | ## Install via Docker | ||
| + | |||
| + | ### Docker | ||
| + | |||
| + | Docker-compose avec Gitlab runner : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | https:// | ||
| + | |||
| + | Configuration du runner | ||
| + | ~~~bash | ||
| + | docker run --rm -ti --name gitlab-runner --add-host gitlab.local: | ||
| + | -v / | ||
| + | -v / | ||
| + | | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | concurrent = 1 | ||
| + | check_interval = 0 | ||
| + | |||
| + | [session_server] | ||
| + | session_timeout = 1800 | ||
| + | |||
| + | [[runners]] | ||
| + | name = " | ||
| + | url = " | ||
| + | token = " | ||
| + | executor = " | ||
| + | [runners.custom_build_dir] | ||
| + | [runners.cache] | ||
| + | [runners.cache.s3] | ||
| + | [runners.cache.gcs] | ||
| + | [runners.cache.azure] | ||
| + | [runners.docker] | ||
| + | tls_verify = false | ||
| + | image = " | ||
| + | privileged = false | ||
| + | disable_entrypoint_overwrite = false | ||
| + | oom_kill_disable = false | ||
| + | disable_cache = false | ||
| + | volumes = ["/ | ||
| + | shm_size = 0 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Gitlab créera de nouveau containers. Ils devrons etre capable de faire un `git clone` | ||
| + | Pour configurer les flux réseaux, ajoutez `clone_url =` | ||
| + | Dans notre exemple 172.18.0.1 est la passerelle par défaut des nouveaux containers crées. | ||
| + | |||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [[runners]] | ||
| + | #url = " | ||
| + | url = " | ||
| + | clone_url = " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `docker-compose.yml` | ||
| + | ~~~yaml | ||
| + | version: ' | ||
| + | services: | ||
| + | gitlab: | ||
| + | image: ' | ||
| + | restart: unless-stopped | ||
| + | hostname: ' | ||
| + | environment: | ||
| + | GITLAB_OMNIBUS_CONFIG: | ||
| + | # | ||
| + | # Add any other gitlab.rb configuration here, each on its own line | ||
| + | ports: | ||
| + | - ' | ||
| + | - ' | ||
| + | - ' | ||
| + | volumes: | ||
| + | - "/ | ||
| + | - "/ | ||
| + | - "/ | ||
| + | networks: | ||
| + | - gitlab-net | ||
| + | |||
| + | gitlab-runner: | ||
| + | image: gitlab/ | ||
| + | restart: unless-stopped | ||
| + | depends_on: | ||
| + | - gitlab | ||
| + | volumes: | ||
| + | - / | ||
| + | - / | ||
| + | networks: | ||
| + | - gitlab-net | ||
| + | |||
| + | networks: | ||
| + | gitlab-net: | ||
| + | name: gitlab-net | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `srv/ | ||
| + | ~~~ruby | ||
| + | gitlab_rails[' | ||
| + | ' | ||
| + | } | ||
| + | |||
| + | gitaly[' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | } | ||
| + | |||
| + | gitlab_rails[' | ||
| + | gitlab_rails[' | ||
| + | gitlab_rails[' | ||
| + | |||
| + | puma[' | ||
| + | puma[' | ||
| + | |||
| + | sidekiq[' | ||
| + | sidekiq[' | ||
| + | postgresql[' | ||
| + | |||
| + | nginx[' | ||
| + | nginx[' | ||
| + | nginx[' | ||
| + | |||
| + | prometheus[' | ||
| + | alertmanager[' | ||
| + | |||
| + | node_exporter[' | ||
| + | redis_exporter[' | ||
| + | postgres_exporter[' | ||
| + | pgbouncer_exporter[' | ||
| + | gitlab_exporter[' | ||
| + | |||
| + | grafana[' | ||
| + | grafana[' | ||
| + | |||
| + | # | ||
| + | gitaly[' | ||
| + | gitaly[' | ||
| + | { | ||
| + | ' | ||
| + | ' | ||
| + | }, { | ||
| + | ' | ||
| + | ' | ||
| + | } | ||
| + | ] | ||
| + | gitaly[' | ||
| + | gitaly[' | ||
| + | gitaly[' | ||
| + | gitaly[' | ||
| + | gitaly[' | ||
| + | gitaly[' | ||
| + | ~~~ | ||
| + | |||
| + | Lancement de Gitlab et de Gitlab-Runner | ||
| + | ~~~bash | ||
| + | docker-compose -d up | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | docker exec -ti gitlab gitlab-ctl reconfigure | ||
| + | docker restart gitlab | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Config WebUI | ||
| + | |||
| + | User : **root** | ||
| + | |||
| + | Password | ||
| + | ~~~bash | ||
| + | docker exec -it gitlab grep ' | ||
| + | ~~~ | ||
| + | |||
| + | Open registration is enabled on your instance. | ||
| + | |||
| + | Admin Area - Settings - General - Sign-up restrictions | ||
| + | |||
| + | Sign-up enabled | ||
| + | Require admin approval for new sign-ups | ||
| + | |||
| + | |||
| + | URL d' | ||
| + | |||
| + | ------ | ||
| + | |||
| + | Le compte admin par defaut est " | ||
| + | |||
| + | |||
| + | --------- | ||
| + | |||
| + | Edit Profile - Account | ||
| + | |||
| + | Change username | ||
| + | ---------- | ||
| + | |||
| + | admin/ | ||
| + | Account and limit | ||
| + | Gravatar enabled | ||
| + | Disable | ||
| + | |||
| + | admin/ | ||
| + | User OAuth applications | ||
| + | Allow users to register any application to use GitLab as an OAuth provider | ||
| + | Disable | ||
| + | |||
| + | admin/ | ||
| + | Third-party offers | ||
| + | Do not display offers from third parties | ||
| + | Checked | ||
| + | |||
| + | admin/ | ||
| + | Metrics - Prometheus | ||
| + | Enable health and performance metrics endpoint | ||
| + | Disable | ||
| + | |||
| + | profile | ||
| + | Private profile | ||
| + | Don't display activity-related personal information on your profile | ||
| + | |||
| + | |||
| + | ---------- | ||
| + | |||
| + | Admin Area - Overview - Users | ||
| + | |||
| + | ------- | ||
| + | |||
| + | #### Config Runners avec Docker | ||
| + | |||
| + | Admin Area - Overview - Runners | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | docker-compose exec gitlab-runner gitlab-runner register | ||
| + | ~~~ | ||
| + | |||
| + | Enter the GitLab instance URL (for example, https:// | ||
| + | http:// | ||
| + | |||
| + | Enter the registration token: | ||
| + | 2_xtsj1yw4sacbWwG46y | ||
| + | |||
| + | Enter an executor: docker, docker-ssh, ssh, docker+machine, | ||
| + | docker | ||
| + | Enter the default Docker image (for example, ruby:2.6): | ||
| + | alpine | ||
| + | |||
| + | |||
| + | #### Reconfig | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | docker-compose exec gitlab gitlab-ctl reconfigure | ||
| + | docker-compose exec gitlab gitlab-ctl restart | ||
| + | ~~~ | ||
| + | |||
| + | ## Pb | ||
| + | |||
| + | ### Erreur dans Gitlab Settings CI/DI - There was an error fetching the environments information. | ||
| + | |||
| + | Solution : | ||
| + | |||
| + | Settings, General, Visibility, project features, permissions | ||
| + | in Pipelines (Build, test, and deploy your changes) select Only Project Members | ||
| + | |||
| + | ## Autres | ||
| + | |||
| + | ### Installation sur Ubuntu 16.04 | ||
| + | |||
| + | https:// | ||
| + | |||
| + | ~~~bash | ||
| + | curl -s https:// | ||
| + | |||
| + | apt-get install gitlab-ce | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | -------------- | ||
| + | GitLab was unable to detect a valid hostname for your instance. | ||
| + | Please configure a URL for your GitLab instance by setting `external_url` | ||
| + | configuration in / | ||
| + | Then, you can start your GitLab instance by running the following command: | ||
| + | sudo gitlab-ctl reconfigure | ||
| + | |||
| + | For a comprehensive list of configuration options please see the Omnibus GitLab readme | ||
| + | https:// | ||
| + | --------------- | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | sudo gitlab-ctl reconfigure | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Optimisation | ||
| + | |||
| + | |||
| + | `/ | ||
| + | ~~~ruby | ||
| + | ##! **recommend value is 1/4 of total RAM, up to 14GB.** | ||
| + | # postgresql[' | ||
| + | postgresql[' | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | gitlab-ctl restart postgresql | ||
| + | ~~~ | ||
| + | |||
| + | Les composants suivants seront automatiquement installés : | ||
| + | * nginx | ||
| + | * postgres | ||
| + | * redis | ||
| + | |||
| + | **A présent connectez vous sur le port 80 et définissez un mot de passe** | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
