1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitlab_ynh.git synced 2024-09-03 18:36:35 +02:00

fix restore

This commit is contained in:
Pierre Bourré 2018-12-24 19:55:59 +01:00
parent b1062284fd
commit 2cb2f36f5d
2 changed files with 15 additions and 9 deletions

View file

@ -41,6 +41,7 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
# Use gitlab-rake to backup # Use gitlab-rake to backup
gitlab-rake gitlab:backup:create gitlab-rake gitlab:backup:create
ynh_backup "$final_path"
ynh_backup "/var/opt/$app/backups/" ynh_backup "/var/opt/$app/backups/"
ynh_backup "$config_path/gitlab-secrets.json" ynh_backup "$config_path/gitlab-secrets.json"
ynh_backup "$config_path/gitlab.rb" ynh_backup "$config_path/gitlab.rb"

View file

@ -44,6 +44,14 @@ test ! -d $final_path \
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_restore_file "$final_path"
ynh_restore_file "/var/opt/$app/backups/"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
#================================================= #=================================================
@ -52,19 +60,16 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_install_app_dependencies openssh-server ynh_install_app_dependencies openssh-server
#================================================= ln -s /opt/gitlab/bin/gitlab-ctl /usr/bin/gitlab-ctl
# RESTORE THE APP MAIN DIR ln -s /opt/gitlab/bin/gitlab-psql /usr/bin/gitlab-psql
#================================================= ln -s /opt/gitlab/bin/gitlab-rails /usr/bin/gitlab-rails
ln -s /opt/gitlab/bin/gitlab-rake /usr/bin/gitlab-rake
setup_source $architecture
ynh_restore_file "$/var/opt/$app/backups/"
gitlab-ctl stop unicorn gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq gitlab-ctl stop sidekiq
fullfile=$(ls /var/opt/$app/backups/*_gitlab* --file -c1 | head -1) fullfile=$(ls /var/opt/gitlab/backups/*_gitlab* --file -c1 | head -1)
basename="/var/opt/$app/backups/" basename="/var/opt/gitlab/backups/"
last_backup="${filename%_gitlab_backup.tar}" last_backup="${filename%_gitlab_backup.tar}"
# Use gitlab-rake to backup # Use gitlab-rake to backup