Otu esi etinye & hazie GitLab na Debian 11 Bullseye

GitLab bụ ebe nchekwa koodu dabere na webụ n'efu na mepere emepe maka mmepe ngwanrọ mmemme maka DevOps, nke edere n'asụsụ mmemme Ruby na Go. Isi okwu GitLab bụ "Weta ọsọ ọsọ na ntụkwasị obi, nchekwa na-enweghị ịchụ àjà, yana visibiliti n'ime ihe ịga nke ọma DevOps." Ọ bụ ihe ọzọ ama ama na GitHub na-enye wiki, nleba anya okwu, yana ntinye aka na nrụnye pipeline na-aga n'ihu, na-eji ikike mepere emepe, nke GitLab Inc mepụtara.

N'ime nkuzi na-esote, ị ga-amụta ka esi etinye GitLab na sistemụ Debian 11 Bullseye gị, yana otu esi amalite site na ịbanye na mgbọrọgwụ ka ị wee malite ịtọ GitLab ka ọ masịrị gị ma ọ bụ maka ihe ndị otu gị chọrọ.

Prerequisites

  • OS akwadoro: Nnenna 11 Bullseye
  • Akaụntụ onye ọrụ: Akaụntụ onye ọrụ nwere sudo ihe ùgwù or ohere mgbọrọgwụ (su Command).

Na-emelite Sistemụ Ọrụ

Melite gi Nnenna 11 Bullseye Sistemụ arụmọrụ iji hụ na ngwugwu niile dị adị adịla ugbu a:

sudo apt update && sudo apt upgrade

Mgbọrọgwụ ma ọ bụ Sudo Access

Site na ndabara, mgbe ị mepụtara akaụntụ gị na mmalite na Debian ma e jiri ya tụnyere nkesa ndị ọzọ, ọ naghị enweta ọkwa sudoers ozugbo. Ị ga-enwerịrị ike ịnweta ya mgbọrọgwụ paswọọdụ iji iwu su ma ọ bụ gaa na nkuzi nkuzi anyị Otu esi etinye onye ọrụ na Sudoers na Debian.

Wụnye ndabere maka GitLab

Tupu ị wụnye GitLab na sistemụ arụmọrụ Debian 11 Bullseye gị, ị ga-achọ ịwụnye ndabere maka ya ka ị nwee ike ịwụnye ma rụọ ọrụ GitLab.

Mepee ọdụ gị wee mebie iwu a:

sudo apt install curl ca-certificates apt-transport-https gnupg2 -y

Advertisement


Mepụta & Bubata ebe nchekwa GitLab

Site na ndabara, GitLab anaghị abịa ngwugwu na ebe nchekwa Debian 11. Nke a pụtara na ị ga-achọ iji aka mepụta otu. Agbanyeghị, GitLab ekepụtala gị ederede APT dị mma ka ibudata na mebie iji nyere gị aka n'ọrụ a.

Budata edemede GitLab APT site na iji iwu iwu:

curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash

Ihe atụ sitere na edemede:

Otu esi etinye & hazie GitLab na Debian 11 Bullseye

Ugbu a, tupu ịga n'ihu, ị ga-achọ ịgbanwe ebe nchekwa GitLab mebere. Nke a bụ n'ihi na ewepụtara Debian 11 Bullseye ọhụrụ, na ha emebeghị ebe nchekwa maka ya. Agbanyeghị, ị ka nwere ike ịwụnye GitLab wee nweta mmelite site na ịgbanwe ebe nchekwa na Debian 10 Buster.

Iji mee nke a, nke mbụ, mepee ya "gitlab_gitlab-ce.list" faịlụ site na iji editọ ederede ọ bụla:

sudo nano /etc/apt/sources.list.d/gitlab_gitlab-ce.list

Na-esote, dochie ahịrị nchekwa abụọ site na "bullseye main" na "buster main."

Ọmụmaatụ si:

deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ bullseye main
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/debian/ bullseye main

Ọmụmaatụ na:

deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ buster main
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/debian/ buster main

Ihe atụ eserese:

Otu esi etinye & hazie GitLab na Debian 11 Bullseye

Ozugbo emere, CTRL + O wee pụọ na faịlụ na CTRL + X.

Ugbu a gbanye iwu mmelite dabara adaba iji nyochaa ma mekọrịta ebe nchekwa ọhụrụ ahụ.

sudo apt update

Rịba ama, nke a nwere ike ịgbanwe n'ọdịnihu, a ga-emelite nkuzi mgbe nke a mere.

Wụnye Gitlab

Akụkụ na-esote nkuzi a bụ ịwụnye GitLab, ma ị ga-ejirịrịrị iwu nwelite nke dabara adaba iji mekọrịta ebe nchekwa emepụtara na emezigharịrị ọhụrụ. Ugbu a mebie iwu wụnye site na iji ihe ndị a:

sudo apt install gitlab-ce

A ga-etinye ihe atụ na ihe ndabere na GitLab:

Otu esi etinye & hazie GitLab na Debian 11 Bullseye

ụdị "Y," wee pịa "Tinye igodo" ịga n'ihu na ntinye. Rịba ama na nha nrụnye bụ 2.5GB, yabụ njikọ ịntanetị dị nwayọ nwere ike chere obere oge ka nbudata na nrụnye ga-agwụ.

Ozugbo echichi mechara, ị kwesịrị ị nweta ihe ndị a na njedebe gị.

It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.
  


     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
  

Thank you for installing GitLab!
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 /etc/gitlab/gitlab.rb file.
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://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help us improve the installation experience, let us know how we did with a 1 min
ute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnib
us&release=14-3

Processing triggers for man-db (2.9.4-2) ...
Processing triggers for ufw (0.36-7.1) ...

Advertisement


Otu esi ahazi GitLab

Na GitLab arụnyere, ị nwere ike hazie SSL ugbu a, ngalaba aha ma ọ bụ okwuntughe aha subdomain, yana ọtụtụ ndị ọzọ. Nkuzi a ga-agafe nhọrọ ntọala ntọala kwesịrị ime. Agbanyeghị, ịnwere ike ịme ntọala ọzọ maka ndị edepụtara n'okpuru.

Nke mbụ, mepee "gitlab.rb" faịlụ nhazi site na iji editọ ederede ọ bụla:

sudo nano nano /etc/gitlab/gitlab.rb

Ntọala mbụ ga-abụ ịtọ ngalaba, ịgagharị na ahịrị 36, yana ịchọta ihe ndị a.

external_url 'https://gitlab.linuxcapable.com'

Gbanwee nke a ka ọ bụrụ aha ngalaba ngalaba gị.

Ihe Nlereanya:

Otu esi etinye & hazie GitLab na Debian 11 Bullseye

Ọzọ, guzobe TLS/SSL na Let's Encrypt, nke na-amalite na ahịrị 2297.

Site na ndabara, a na-eji "#" kọwaa ntọala niile. Ị ga-achọ ikwughachi ahịrị ndị a.

 letsencrypt['enable'] = true
 letsencrypt['contact_emails'] = ['youremail@yourdomain.com']
 letsencrypt['auto_renew'] = true
 letsencrypt['auto_renew_hour'] = 4
 letsencrypt['auto_renew_day_of_month'] = "*/4"
 letsencrypt['auto_renew_log_directory'] = '/var/log/gitlab/lets-encrypt'

Ihe Nlereanya:

Otu esi etinye & hazie GitLab na Debian 11 Bullseye

Ozugbo emere, CTRL + O wee pụọ na faịlụ na CTRL + X.

Ugbu a na-agba ọsọ reconfigure iwu dị ka ndị a.

sudo gitlab-ctl reconfigure

N'ikpeazụ, ị ga-enweta ozi a na ọdụ gị.

Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Running handlers complete
Chef Infra Client failed. 218 resources updated in 41 seconds

Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Ka ilele mgbọrọgwụ (GitLab) paswọọdụ, mee iwu na-esonụ.

cat /etc/gitlab/initial_root_password

Ihe atụ mmepụta:

# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: SGGg/WQ9+N1JdgouIbPftla+Kt8Qcyr+HL5oJfRbBmM=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

Dị ka n'elu, ị nwere ike ịhụ paswọọdụ bụ "SGGg/WQ9+N1JdgouIbPftla+Kt8Qcyr+HL5oJfRbBmM=" na a ga-ehichapụ faịlụ a na-akpaghị aka n'ime awa 24.

Otu esi enweta GitLab

Ugbu a edobere azụ azụ, ọ bụ oge ịbanye wee hụ GitLab gị.

Nke mbụ, mepee ụzọ ngalaba ebe e kenyere GitLab na faịlụ nhazi.

Ihe Nlereanya:

https://gitlab.example.com

Ọzọ, jiri aha njirimara banye "Mgbọrọgwụ" na paswọọdụ ị nwetara, nke dị na nkuzi nkuzi bụ "SGGg/WQ9+N1JdgouIbPftla+Kt8Qcyr+HL5oJfRbBmM=".

Ihe Nlereanya:

Otu esi etinye & hazie GitLab na Debian 11 Bullseye

Ị banye nke ọma dị ka akaụntụ mgbọrọgwụ, ị ga-akụkwa ibe ọdịda ndabara.

Ihe Nlereanya:

Otu esi etinye & hazie GitLab na Debian 11 Bullseye

Site ebe a, ị nwere ike ịga n'ihu ịtọlite ​​​​na hazie GitLab ka ọ dabara ihe gị chọrọ ma ọ bụ otu gị. Otu n'ime ihe mbụ ị ga-eme bụ ịga na ngalaba nchịkwa wee hazie nchekwa, dị ka 2FA, ịgbanwe okwuntughe mgbọrọgwụ, na ọtụtụ ndị ọzọ tupu ịtinye ndị otu ọ bụla. Enwere ike ịchọta ihe niile site na ịpị NchNhr > Onye nchịkwa n'elu aka ekpe akụkụ nke ibe.

Ihe Nlereanya:

Otu esi etinye & hazie GitLab na Debian 11 Bullseye

Advertisement


Mepụta Cronjob maka GitLab Nchekwa akpaaka

Site na ndabara, enweghị nkwado ndabere na mpaghara emepụtara ma ọ bụ ahaziri. Ekwesịrị ịtọ nke a site na iji cronjob, ugboro ole na-atọkwa uru dabara maka nnweta akụrụngwa yana ugboro mgbanwe GitLab.

Nke mbụ, mepee crontab gị.

sudo crontab -e

Na-esote, tinye ihe atụ na-esonụ ma gbanwee oge iji kwado mkpa gị. Ọ bụrụ na ị maghị oge maka oge, wee gaa crontab.guru.

00 */3 * * *   root gitlab-rake gitlab:backup:create

Ihe dị n'elu na-emepụta ndabere kwa awa 3 kpọmkwem.

Ihe Nlereanya:

Otu esi etinye & hazie GitLab na Debian 11 Bullseye

Ozugbo emere, CTRL + O wee pụọ na faịlụ na CTRL + X.

N'aka nke ọzọ, ịnwere ike iji aka rụọ ọrụ ahụ n'oge ọ bụla site na ịme iwu na-esonụ.

sudo gitlab-rake gitlab:backup:create

Ozugbo ndabere e dechara, ị ga-enweta ozi na-esonụ na gị ọnụ.

Backup task is done.

Okwu na mmechi

N'ime nkuzi na-esote, ị mụtala ka esi etinye GitLab na Debian 11 Bullseye, guzobe TLS/SSL na Lets Encrypt, wee mepụta ọrụ cron ndabere. N'ozuzu, GitLab na-akwado onwe ya nwere ike ịdị mkpa karịa ịdabere na onye ọzọ ma ọ bụrụ na nzuzo bụ nnukwu nchegbu ma nwee ike ime ka mmepe dị mfe na ngwa ngwa.

Ahapụ a Comment