Legacy Engineering Note · 기존 기술 블로그에서 선별 이관한 기록입니다. 작성 당시 환경과 버전을 기준으로 합니다.
Gitlab 설치
- 패키지 업데이트: VM에 접속한 후, 아래 명령어를 실행하여 패키지 리스트를 업데이트
shellsudo apt-get update sudo apt-get upgrade
- 필수 소프트웨어 설치
- GitLab을 설치하기 위해 필요한 curl 및 Postfix를 설치
- Postfix는 이메일 알림을 위해 사용
shellsudo apt-get install -y curl openssh-server ca-certificates postfix # 설치 중 Postfix 구성 화면이 나타나면, 'Internet Site'를 선택하고 도메인 이름을 설정
- GitLab Repository 추가: GitLab의 공식 스크립트를 사용하여 GitLab CE (Community Edition) 저장소 추가
shellcurl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
- GitLab 설치: 저장소가 추가되면, 다음 명령어로 GitLab을 설치
shellsudo EXTERNAL_URL="http://[VM의 공용 IP 주소]" apt-get install gitlab-ce sudo EXTERNAL_URL="http://52.141.42.80" apt-get install gitlab-ce
- 설치 완료 후 관리자 계정 비밀번호 확인(24시간 이후 자동삭제)
shellsudo cat /etc/gitlab/initial_root_password # 명령어 실행 master@CICD:~$ sudo cat /etc/gitlab/initial_root_password # 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: 2reHveD7jIBuyp4CZKVKTbJVtAMexGlJmOmyWeTeonA= # NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
-
관리자 계정 로그인 후 비밀번호 변경 필
- ID : root
- pw : 2reHveD7jIBuyp4CZKVKTbJVtAMexGlJmOmyWeTeonA=
-
초기 비밀번호가 이미 삭제된 경우
- GitLab Rails 콘솔에 접속: sudo gitlab-rails console
- root 사용자를 찾고 비밀번호를 재설정
shell
user = User.find_by_username('root') user.password = '새로운_비밀번호' user.password_confirmation = '새로운_비밀번호' user.save! - 콘솔 종료 : exit