자체 컴파일 설치를 위한 패치 버전의 범용 업데이트 가이드
Tier: Free, Premium, Ultimate
Offering: Self-managed
설치할 버전 선택
GitLab의 원하는 태그(버전)에서 이 업데이트 가이드를 확인하세요. 대부분의 경우 가장 높은 번호의 프로덕션 태그(여기에 rc
가 없는 것)여야 합니다. GitLab의 왼쪽 상단에 있는 버전 드롭다운 목록에서 태그를 선택할 수 있습니다.
0. 백업
어떤 일이 벌어질지 모르니 예방 차원에서 백업을 만드세요. 설치 방법에 따라 백업 명령이 다를 수 있습니다. GitLab 백업 및 복원 문서를 참조하세요.
1. 서버 중지
# systemd를 사용하는 시스템의 경우
sudo systemctl stop gitlab.target
# SysV init를 사용하는 시스템의 경우
sudo service gitlab stop
2. 안정 브랜치의 최신 코드 가져오기
아래 명령어에서 LATEST_TAG
를 설치하려는 최신 GitLab 태그로 교체하세요. 예를 들어 v8.0.3
와 같이 패치 버전만 업데이트하세요 (현재 버전은 cat VERSION
으로 확인하세요).
cd /home/git/gitlab
sudo -u git -H git fetch --all
sudo -u git -H git checkout -- Gemfile.lock db/structure.sql locale
sudo -u git -H git checkout LATEST_TAG -b LATEST_TAG
3. 라이브러리, 마이그레이션 등 설치
cd /home/git/gitlab
# 설치 중이나 이전 업그레이드에서 아직 수행하지 않았다면
sudo -u git -H bundle config set --local deployment 'true'
sudo -u git -H bundle config set --local without 'development test kerberos'
# 젬 업데이트
sudo -u git -H bundle install
# 선택사항: 이전 버전의 젬 정리
sudo -u git -H bundle clean
# 데이터베이스 마이그레이션 실행
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
# 에셋 및 캐시 정리
sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile cache:clear RAILS_ENV=production NODE_ENV=production NODE_OPTIONS="--max_old_space_size=4096"
4. GitLab Workhorse를 해당 버전으로 업데이트
cd /home/git/gitlab
sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" RAILS_ENV=production
5. Gitaly를 해당 버전으로 업데이트
cd /home/git/gitlab
sudo -u git -H bundle exec rake "gitlab:gitaly:install[/home/git/gitaly,/home/git/repositories]" RAILS_ENV=production
6. GitLab Shell를 해당 버전으로 업데이트
cd /home/git/gitlab-shell
sudo -u git -H git fetch --all --tags
sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -b v$(</home/git/gitlab/GITLAB_SHELL_VERSION)
sudo -u git -H make build
7. GitLab Pages를 해당 버전으로 업데이트 (사용하지 않는 경우 건너뜁니다)
cd /home/git/gitlab-pages
sudo -u git -H git fetch --all --tags
sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION)
sudo -u git -H make
8. gitlab-elasticsearch-indexer
설치/업데이트
Tier: Premium, Ultimate
Offering: Self-managed
설치 지침을 따르세요.
9. 어플리케이션 시작
# systemd를 사용하는 시스템의 경우
sudo systemctl start gitlab.target
sudo systemctl restart nginx.service
# SysV init를 사용하는 시스템의 경우
sudo service gitlab start
sudo service nginx restart
10. 어플리케이션 상태 확인
GitLab 및 해당 환경이 올바르게 구성되었는지 확인하세요:
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
누락된 사항이 없는지 확인하려면 더 철저한 검사를 수행하세요:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
모든 항목이 초록색이라면, 축하합니다 업그레이드가 완료되었습니다!
11. 백그라운드 마이그레이션 완료 확인
백그라운드 마이그레이션 상태를 확인하고 완료되었는지 확인하세요.