์ƒˆ์†Œ์‹

DevOps/Git

[GitLab] ๊นƒ๋žฉ ์šฐ๋ถ„ํˆฌ(Ubuntu)์„œ๋ฒ„์— ์„ธํŒ…

  • -

 

 

 

์šฐ๋ถ„ํˆฌ(Ubuntu) OS์—์„œ ๊นƒ๋žฉ(GitLab) ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•˜๊ฒŒ ๋˜์–ด ๊ธฐ๋ก ๋ชฉ์ ์œผ๋กœ ์ž‘์„ฑ๋œ ๊ธ€์ž…๋‹ˆ๋‹ค. GitLab ์„ค์น˜ ๋ฐฉ๋ฒ•์€ ์ฐพ์•„๋ณธ ๊ฒฐ๊ณผ, ์„ค์น˜๋ฐฉ์‹์ด ๋ณ€๊ฒฝ๋˜๋Š” ์ด์Šˆ๊ฐ€ ์ข…์ข… ๋ฐœ์ƒํ•˜๋‹ˆ ์ฐธ๊ณ ์šฉ์œผ๋กœ๋งŒ ํ™•์ธํ•˜์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜ ๋„์ค‘์— ์•ˆ๋  ๊ฒฝ์šฐ ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ๋ฐฉ๋ฒ•์„ ์ฐพ์œผ์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.

 

์ฐธ๊ณ ์‚ฌ์ดํŠธ

https://about.gitlab.com/install/#ubuntu

 

Download and install GitLab

Learn about the various GitLab installation packages and downloads for Ubuntu, Debian, Docker, Google Cloud, and many more.

about.gitlab.com


 

GitLab ์„ค์น˜

ํ•„์ˆ˜์ ์ธ ์˜์กด์„ฑ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์ • ๋ฐ ์„ค์น˜๋ฅผ ์ง„ํ–‰

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


๋ฉ”์ผ ๋ฐœ์†ก์„ ์œ„ํ•œ Postfix ๋ฅผ ์„ค์น˜

sudo apt-get install -y postfix


[gitlab-ce ์„ค์น˜๋ฐฉ๋ฒ•] Gitlab ํŒจํ‚ค์ง€ ๋ ˆํผ์ง€ํ† ๋ฆฌ๋ฅผ ์ถ”๊ฐ€ํ•œ ํ›„ ์„ค์น˜

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash 
sudo EXTERNAL_URL="http://gitlab.example.com/" apt-get install gitlab-ce

 

-> http://gitlab.example.com/ : IP:PORT๋กœ ๋ณ€๊ฒฝ ๋“ฑ๋ก ๊ฐ€๋Šฅ

 

[gitlab-ee ์„ค์น˜๋ฐฉ๋ฒ•] GitLab ํŒจํ‚ค์ง€ ์ €์žฅ์†Œ ์ถ”๊ฐ€ ๋ฐ ํŒจํ‚ค์ง€ ์„ค์น˜

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" apt-get install gitlab-ee

 

-> http://gitlab.example.com/ : IP:PORT๋กœ ๋ณ€๊ฒฝ ๋“ฑ๋ก ๊ฐ€๋Šฅ

 

IP:PORT๋กœ ๋ณ€๊ฒฝ์ด ์•ˆ๋์„ ๊ฒฝ์šฐ ์„ค์ •์„ ์œ„ํ•ด gitlab.rbํŒŒ์ผ ์—ด๊ธฐ

sudo vi /etc/gitlab/gitlab.rb


๋‚ด๋ฆฌ๋‹ค ๋ณด๋ฉด external_url์ด๋ผ๊ณ  ๋˜์–ด ์žˆ๋Š” ๋ถ€๋ถ„์ด ๋ณด์ž…๋‹ˆ๋‹ค. ๊ธฐ์กด์— gitlab.example.com ์œผ๋กœ ๋˜์–ด ์žˆ์œผ๋‚˜, ์ž์‹ ์˜ ์ฃผ์†Œ์™€ ํฌํŠธ์— ๋งž๊ฒŒ ๋ณ€๊ฒฝํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
์˜ˆ์‹œ) external_url 'http://xxx.xxx.xxx.xxx:9000'
๋ณ€๊ฒฝ ํ›„์— ์„ค์ • ์ ์šฉ

sudo gitlab-ctl reconfigure

 

 

์ดํ›„์— ์ž์‹ ์ด ์„ค์ •ํ•œ IP:PORT๋กœ URL ์ ‘์† ํ›„ ํ™•์ธ

 


GitLab ์‚ญ์ œ

์‚ญ์ œ ๋ฐฉ๋ฒ•

sudo gitlab-ctl cleanse
sudo gitlab-ctl uninstall
sudo apt-get remove gitlab-ee
sudo apt-get purge gitlab-ee

 

๋˜๋Š”

sudo apt-get remove gitlab-ce
sudo apt-get purge gitlab-ce


์•„๋ž˜ ํด๋” ์‚ญ์ œ

/opt/gitlab
/var/opt/gitlab
/etc/gitlab
/var/log/gitlab
/etc/yum.repos.d/gitlab ๊ด€๋ จํŒŒ์ผ

 

(์ถ”๊ฐ€) ์‚ญ์ œ ๋ช…๋ น์–ด
dir1 ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์‚ญ์ œ. ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ์‚ญ์ œํ•  ๋•Œ๋Š” -r ์˜ต์…˜

rm -r dir1

 

f ์˜ต์…˜์„ ์ถ”๊ฐ€ํ•˜๋ฉด ์‚ญ์ œํ•  ๊ฑด์ง€ ๋ฌป์ง€ ์•Š๊ณ  ๋ฐ”๋กœ ์‚ญ์ œ

rm -rf dir1

 

 

GitLab root ๊ณ„์ • ์ตœ์ดˆ ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ • ๋ฐฉ๋ฒ•

# sudo gitlab-rails console -e production
# user = User.where(id: 1).first
# => #<User id:1 @root>
# user.password='[๋ณ€๊ฒฝํ•  ๋น„๋ฐ€๋ฒˆํ˜ธ]'
# user.password_confirmation='[๋ณ€๊ฒฝํ•  ๋น„๋ฐ€๋ฒˆํ˜ธ]'
# user.save
# => true
# exit

 

** ๋ณ€๊ฒฝํ•  ๋น„๋ฐ€๋ฒˆํ˜ธ์˜ ๋””ํดํŠธ ์ตœ์†Œ๊ธธ์ด๋Š” 8์ž๋ฆฌ๋กœ ์ถ”์ •๋˜๋ฏ€๋กœ ์ฐธ๊ณ  ๋ฐ”๋ž๋‹ˆ๋‹ค.

 


GitLab ๊ด€๋ จ ๋ช…๋ น์–ด ์ •๋ฆฌ

์„ค์ • ์ ์šฉ

gitlab-ctl reconfigure

 

์„œ๋น„์Šค ์žฌ์‹œ์ž‘

gitlab-ctl restart

 

์„œ๋น„์Šค ์ƒํƒœ ํ™•์ธ

gitlab-ctl status

 

์„œ๋น„์Šค ์ค‘์ง€

gitlab-ctl stop

 

 

[Ubuntu] ์šฐ๋ถ„ํˆฌ ์„œ๋ฒ„ ์„ธํŒ…

 

[Ubuntu] ์šฐ๋ถ„ํˆฌ ์„œ๋ฒ„ ์„ธํŒ…

์šฐ๋ถ„ํˆฌ(Ubuntu)์„œ๋ฒ„์— ๋ฆฌ๋ˆ…์Šค(Linux)์„ค์น˜๋ฅผ ๊ธฐ๋ก ๋ชฉ์ ์œผ๋กœ ์ •๋ฆฌ ๋ฐ ์ž‘์„ฑ ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•˜๊ฒŒ ์ •๋ฆฌํ•˜์ž๋Š” ๋ชฉ์ ์ด๋ผ ์ƒ์„ธํ•˜๊ฒŒ ์ •๋ฆฌ๋˜์–ด ์žˆ์ง€๋Š” ์•Š์„ ๊ฒ๋‹ˆ๋‹ค. ํ•„์š”ํ•œ ๋ถ€๋ถ„์€ ๋ฆฌ์„œ์นญ์„ ํ†ตํ•ด ์ฑ„์›Œ์ฃผ์‹œ

sm-code.tistory.com

 

[GitLab] ๊นƒ๋žฉ ๋กœ๊ทธ์ธ ํ™”๋ฉด ์ปค์Šคํ„ฐ๋งˆ์ด์ง•

 

[GitLab] ๊นƒ๋žฉ ๋กœ๊ทธ์ธ ํ™”๋ฉด ์ปค์Šคํ„ฐ๋งˆ์ด์ง•

๊นƒ๋žฉ(GitLab)์—์„œ ๋กœ๊ทธ์ธ ํ™”๋ฉด ์ปค์Šคํ„ฐ๋งˆ์ด์ง•์„ ํ†ตํ•ด ์ž…๋ง›์— ๋งž๊ฒŒ ๋ณ€๊ฒฝํ•˜๊ณ  ์‹ถ์€๋ฐ ์ƒ๊ฐ์™ธ๋กœ ์ž๋ฃŒ๊ฐ€ ๋งŽ์ง€ ์•Š์•„์„œ ๊ธฐ๋ก ๋ชฉ์ ์œผ๋กœ ์ž‘์„ฑ๋˜์—ˆ์œผ๋ฏ€๋กœ ์ฐธ๊ณ ์šฉ์œผ๋กœ๋งŒ ๋ด์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์„ค์ • ๋ฐฉ

sm-code.tistory.com

[GitLab] ๊นƒ๋žฉ SSL์ ์šฉ ๋ฐ ์ž๋™๊ฐฑ์‹ 

 

[GitLab] ๊นƒ๋žฉ SSL์ ์šฉ ๋ฐ ์ž๋™๊ฐฑ์‹ 

๊นƒ๋žฉ(GitLab)์„ ์‹ค์ œ ์šด์˜ํ•˜๊ธฐ ์œ„ํ•ด์„œ ๋„๋ฉ”์ธ๊ณผ SSL๋“ฑ๋ก์„ ์ง„ํ–‰ํ•˜์˜€๊ณ , ๊ทธ ๊ณผ์ •์„ ๊ธฐ๋กํ•˜๋Š” ๋ชฉ์ ์œผ๋กœ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค. ๋” ์ข‹์€ ๋ฐฉ๋ฒ•์œผ๋กœ ํ•˜์…”๋„ ๋ฌด๋ฐฉํ•ฉ๋‹ˆ๋‹ค. ์ด ๊ธ€์€ ์ฐธ๊ณ ์šฉ์œผ๋กœ๋งŒ ๋ด์ฃผ์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ

sm-code.tistory.com

[GitLab] ๊นƒ๋žฉ ๋งˆ์ดํฌ๋กœ์†Œํ”„ํŠธ(MS) ๊ณ„์ • SSO ์„ค์ •

 

[GitLab] ๊นƒ๋žฉ ๋งˆ์ดํฌ๋กœ์†Œํ”„ํŠธ(MS) ๊ณ„์ • SSO ์„ค์ •

๊นƒ๋žฉ์€ OmniAuth๋ผ๋Š” ๋ชจ๋“ˆ์„ ๋‚ด์žฅํ•˜์—ฌ SSO(Single Sign On)์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด ๋งค์šฐ ๋‹ค์–‘ํ•œ ์ธ์ฆ ํ”„๋กœ๋ฐ”์ด๋”๋ฅผ ์ง€์›ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. https://docs.gitlab.com/ee/integration/omniauth.html#supported-providers ์ด ๋ฌธ์„œ

sm-code.tistory.com

 

Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ˜Š

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๐Ÿ‘