[git] Ubuntu 20.04에 GitLab 설치

seoyoon·2022년 5월 2일
0

0. 개요

깃랩(GitLab)은 깃랩 사(GitLab Inc.)가 개발한 깃 저장소 및 CI/CD, 이슈 추적, 보안성 테스트 등의 기능을 갖춘 웹 기반의 데브옵스 플랫폼입니다.
오늘은 온프레미스 방식으로 GitLab을 설치해보도록 하겠습니다.

1. 시스템 업데이트

sudo apt update
sudo apt upgrade -y

2. 의존성 설치

sudo apt install -y ca-certificates curl openssh-server

3. GitLab-CE repository 추가

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

아래와 같은 메시지가 뜬다면 추가 완료 된 것 입니다.

The repository is setup! You can now install packages.

4. GitLab 설치

sudo apt update
sudo apt -y install gitlab-ce

설치가 완료 되면 아래와 같이 여우 모양이 뜨게 됩니다.


Selecting previously unselected package gitlab-ce.
(Reading database ... 92556 files and directories currently installed.)
Preparing to unpack .../gitlab-ce_14.10.0-ce.0_amd64.deb ...
Unpacking gitlab-ce (14.10.0-ce.0) ...
Setting up gitlab-ce (14.10.0-ce.0) ...
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 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=14-10

5. GitLab 설정 변경

sudo vi /etc/gitlab/gitlab.rb

해당 부분을 Ip:port으로 변경해줍니다.

external_url 'http://loaclhost:8081'

설정을 적용하기 위해 재시작을 합니다.

sudo gitlab-ctl reconfigure

6. root 초기 비밀번화 확인 및 변경

1) root 계정 초기 비밀 번호

sudo su
cat /etc/gitlab/initial_root_password

2) root 계정 비밀 번호 변경

sudo gitlab-rails console -e production

user = User.where(id:1).first

user.password='변경할 비밀번호'
user.password_confirmation='변경할 비밀번호 재확인'
user.save

exit
profile
Backend Developer

0개의 댓글