mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(gitlab-package): create configuration backups
This commit is contained in:
@@ -150,6 +150,10 @@ sudo gitlab-backup create BACKUP='prefix_override' STRATEGY='copy'
|
||||
sudo gitlab-backup create … \
|
||||
SKIP='db,repositories,uploads,builds,artifacts,pages,lfs,terraform_state,registry,packages,ci_secure_files'
|
||||
|
||||
# Create backups of the configuration.
|
||||
sudo gitlab-ctl backup-etc
|
||||
sudo gitlab-ctl backup-etc && ls -t '/etc/gitlab/config_backup/' | head -n '1'
|
||||
|
||||
# Restore backups.
|
||||
sudo aws s3 cp 's3://backups/gitlab/gitlab-secrets.json' '/etc/gitlab/gitlab-secrets.json' \
|
||||
&& sudo aws s3 cp 's3://backups/gitlab/gitlab.rb' '/etc/gitlab/gitlab.rb' \
|
||||
|
||||
@@ -82,12 +82,30 @@ gitlab-rails runner '
|
||||
# --------------------------------------
|
||||
##
|
||||
|
||||
# Check services
|
||||
sudo gitlab-ctl status
|
||||
|
||||
# Get logs
|
||||
sudo gitlab-ctl tail
|
||||
sudo gitlab-ctl tail 'prometheus'
|
||||
|
||||
# Backup data
|
||||
sudo gitlab-backup create
|
||||
sudo gitlab-backup create STRATEGY=copy
|
||||
|
||||
# Backup configuration
|
||||
sudo gitlab-ctl backup-etc \
|
||||
&& ls -t '/etc/gitlab/config_backup/' \
|
||||
| head -n '1' \
|
||||
| xargs -pI '{}' aws s3 cp '/etc/gitlab/config_backup/'{} 's3://backups/gitlab/'
|
||||
|
||||
# Package upgrade
|
||||
sudo yum check-update
|
||||
sudo yum info 'gitlab-ee' # informational
|
||||
sudo rpm -qa | grep 'gitlab-ee' # informational
|
||||
sudo yum --showduplicates list available 'gitlab-ee'
|
||||
sudo gitlab-backup create # not strictly necessary: the upgrade will create a partial one
|
||||
sudo gitlab-ctl backup-etc
|
||||
tmux new-session -A -s 'gitlab-upgrade' "sudo yum update 'gitlab-ee'" # 'gitlab-ee-16.11.3' if version-specific
|
||||
sudo gitlab-rake 'gitlab:check'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user