자체 컴파일 설치용 패치 버전을 위한 통합 업데이트 가이드
설치할 버전 선택
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
와 같습니다. 모든 태그 디렉터리은 git tag -l 'v*.[0-9]' --sort='v:refname'
를 사용하여 볼 수 있습니다. 현재 버전은 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
설치/업데이트
설치 지침을 따르세요.
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. 백그라운드 마이그레이션 완료 여부 확인
백그라운드 마이그레이션 상태 확인하여 완료되었는지 확인하십시오.