깃랩

깃랩 설치

bo20cy 2024. 12. 9. 01:40

깃랩이란

GitLab은코드를 서버에 저장할 수 있는 일부 무료 오픈소스 플랫폼입니다. 버전 관리, CI/CD, 프로젝트 관리, 코드 리뷰 기능을 제공하며, GitLab은 Git을 기반으로 리포지토리 관리 시스템부터 코드를 저장부터 배포, 운영하는 모든 과정을 지원합니다.

 

 

하기전에 CentOS yum package가 작동하지 않을 확률이 높으니 바꾸어주자.

/etc/yum.repos.d/CentOS-Base.repo

더보기

# CentOS-EOL.repo
#
# This is an example config which can be used to deal with EOL RHEL
# You MUST look to mirroring this locally if you want long term access
#

[base]
name=CentOS-$releasever - Baseㅑ
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://archive.kernel.org/centos-vault/7.9.2009/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://archive.kernel.org/centos-vault/7.9.2009/extras/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://archive.kernel.org/centos-vault/7.9.2009/centosplus/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

 

 

 

 

 

 

 

공식 깃랩 설치


https://about.gitlab.com/install/#centos-7

 

Download and install GitLab

Download, install and maintain your own GitLab instance with various installation packages and downloads for Linux, Kubernetes, Docker, Google Cloud and more.

about.gitlab.com

 

 

 

 

  • 설치하기전 필요한 설치파일들
#필수 설치파일
yum install -y curl policycoreutils-python openssh-server perl

#ssh활성화
systemctl enable sshd
systemctl start sshd

# 방화벽 
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld

#이메일 전송 설치
yum install postfix
systemctl enable postfix
systemctl start postfix

#리포지토리 설치 쉘
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

 

 

 

 

 

 

 

 

 

 

 

 

#깃랩 설치
yum --showduplicate list

EXTERNAL_URL="localhost:9000" yum install -y gitlab-ce-16.6.6-ce.0.el7 

 

 

gitlab-ctl status로 확인

 

 

 

 

 

 

 

 

 

 

  • root 비밀번호 찾기

cat /etc/gitlab/initial_root_password

 

 

  • root 비밀번호 변경

 

 

콘솔에 들어가서 잘 되는지 확인하고 root비밀번호 바꾸면 끝

 

 

 

변경하고 재집입 하자

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 터미널에서도 가능합니다.(콘솔 진입이 생각보다 느립니다.)

 

#콘솔 진입
gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]
 GitLab:       16.6.6 (d9ed0143844) FOSS
 GitLab Shell: 14.30.0
 PostgreSQL:   13.12
------------------------------------------------------------[ booted in 30.75s ]
Loading production environment (Rails 7.0.8)

#비밀번호 바꾸기 시작
irb(main):001:0> user=User.where(id:1).first
=> #<User id:1 @root>
irb(main):002:0> user.password='비밀번호'
=> "비밀번호"
irb(main):003:0> user.password_confirmation='비밀번호'
=> "비밀번호"
irb(main):004:0> user.save
=> true
irb(main):005:0> exit

 

출처

https://potato-yong.tistory.com/145

https://idox.tistory.com/entry/GitLab-CentOS-7%EC%97%90-GitLab-ce-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-curlyum-%EC%9D%B4%EC%9A%A9%ED%95%9C-%EC%98%A8%EB%9D%BC%EC%9D%B8-%EC%84%A4%EC%B9%98

https://memories.tistory.com/168

https://bsssss.tistory.com/711

https://twoicefish-secu.tistory.com/464

https://jstorysince27.tistory.com/85