From 520982ddb2495c608ddb38a23affce8beef038dc Mon Sep 17 00:00:00 2001 From: Cyril Blaecke Date: Mon, 4 Apr 2022 13:17:27 +0200 Subject: [PATCH 1/6] 14.9.2 --- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index 434ef11..cd9d26a 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "GitLab", "id": "gitlab", "packaging_format": 1, - "version": "14.9.1~ynh2", + "version": "14.9.2~ynh1", "description": { "en": "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features", "fr": "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD" diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 48bfac7..0df167e 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,15 +1,15 @@ #!/bin/bash -gitlab_version="14.9.1" +gitlab_version="14.9.2" # sha256sum found here: https://packages.gitlab.com/gitlab gitlab_debian_version="$(lsb_release -sc)" -gitlab_x86_64_bullseye_source_sha256="c5945ec778701ed1f29d663527929102c17527e75e0a07804c2d58ae74d0786e" -gitlab_x86_64_buster_source_sha256="d1546e23522690b3f314e1edbb165d24684dd70de2c6e075a040d02b5e48dfb2" +gitlab_x86_64_bullseye_source_sha256="4a9b94edcd97f09198aeb8f64d973f0a892f6554d18afedf688ae9d1ca21e9b3" +gitlab_x86_64_buster_source_sha256="f51e05dd6d352a5b5c13e174ddf70c71c60109140b9274b77ae63c61eb701611" -gitlab_arm64_bullseye_source_sha256="6e0a03d5aa85797610ca1eea24f2bbe1c974f61e04673ad00391c7dedd236ae7" -gitlab_arm64_buster_source_sha256="f883acc3fdad0cf27080a247abd94891724d452f8e75e9f1b19a07121af702b3" +gitlab_arm64_bullseye_source_sha256="7826fad61eae70138ff06a33b3471466a11c5237c0960daecde1b94a3e694265" +gitlab_arm64_buster_source_sha256="6b4493b2d55ad6cd796036324dd1953e58ecb7ccf80dc4d02f5a4dbf0d56c8b8" gitlab_arm_buster_source_sha256="c8fcc05aa2ede0556798b732dd823c8d7f8b153a7c6683cc2f619f014429679e" From a54380996eb05b63399cceb6add2edbd19ec65a6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 4 Apr 2022 11:33:58 +0000 Subject: [PATCH 2/6] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f12f94..242a312 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features -**Shipped version:** 14.9.1~ynh2 +**Shipped version:** 14.9.2~ynh1 **Demo:** https://gitlab.com/explore diff --git a/README_fr.md b/README_fr.md index e80437d..15303e3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD -**Version incluse :** 14.9.1~ynh2 +**Version incluse :** 14.9.2~ynh1 **Démo :** https://gitlab.com/explore From 2d9b99aaf0e355bd75f83b40666a9abea40b6b55 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Mon, 4 Apr 2022 13:45:48 +0200 Subject: [PATCH 3/6] [fix] arm source 14.9.2 for buster --- scripts/upgrade.d/upgrade.last.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 0df167e..4dd2984 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -11,7 +11,7 @@ gitlab_x86_64_buster_source_sha256="f51e05dd6d352a5b5c13e174ddf70c71c60109140b92 gitlab_arm64_bullseye_source_sha256="7826fad61eae70138ff06a33b3471466a11c5237c0960daecde1b94a3e694265" gitlab_arm64_buster_source_sha256="6b4493b2d55ad6cd796036324dd1953e58ecb7ccf80dc4d02f5a4dbf0d56c8b8" -gitlab_arm_buster_source_sha256="c8fcc05aa2ede0556798b732dd823c8d7f8b153a7c6683cc2f619f014429679e" +gitlab_arm_buster_source_sha256="38033ef2cfcf23e466795a3630645a45cbc1ca771d4273e29398ec7641255ef1" architecture=$(ynh_app_setting_get --app="$app" --key=architecture) @@ -34,8 +34,8 @@ elif [ "$architecture" = "arm64" ]; then elif [ "$architecture" = "arm" ]; then # If the version for arm doesn't exist, then use an older one if [ -z "$gitlab_arm_buster_source_sha256" ]; then - gitlab_version="14.9.1" - gitlab_arm_buster_source_sha256="c8fcc05aa2ede0556798b732dd823c8d7f8b153a7c6683cc2f619f014429679e" + gitlab_version="14.9.2" + gitlab_arm_buster_source_sha256="38033ef2cfcf23e466795a3630645a45cbc1ca771d4273e29398ec7641255ef1" fi gitlab_source_sha256=$gitlab_arm_buster_source_sha256 fi From 8a5095f166f2cabca0fc636f35cde93d61b563d6 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 21 Oct 2021 14:14:35 +0200 Subject: [PATCH 4/6] wait migrations --- scripts/upgrade | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9d442f1..75f6618 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -286,8 +286,7 @@ then ynh_setup_source --dest_dir=$tempdir --source_id=$architecture - if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ; - then # This command will fail in lxc env + if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename; then # This command will fail in lxc env package_check_action # defined in upgrade.d/upgrade.X.sh ynh_exec_warn_less dpkg --configure gitlab-ce fi @@ -314,6 +313,16 @@ then ynh_secure_remove --file="/tmp/gitlab_upgrade_$current_version.log" fi fi + + + # https://docs.gitlab.com/ee/update/#checking-for-background-migrations-before-upgrading + if dpkg --compare-versions "$current_version" "ge" "12.9"; then + while ! gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining' + do + ynh_print_info --message="Wait for the migration in the background to finish" + sleep 1 + done + fi done fi From c9f3c1ae34a9ae0c2f404ab75714bd9b1903df39 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Tue, 5 Apr 2022 12:12:06 +0200 Subject: [PATCH 5/6] [fix] No infinite loop --- scripts/upgrade | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 75f6618..250852c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -317,8 +317,16 @@ then # https://docs.gitlab.com/ee/update/#checking-for-background-migrations-before-upgrading if dpkg --compare-versions "$current_version" "ge" "12.9"; then + + counter=0 while ! gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining' do + counter=$((counter + 1)) + if [ $counter -gt 1200 ] + then + ynh_print_warn --message="Timeout: a background migration runs for at least 20min !" + break + fi ynh_print_info --message="Wait for the migration in the background to finish" sleep 1 done From 56b6f5005380bf7740b59a5d1d644895db178887 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 5 Apr 2022 16:40:14 +0200 Subject: [PATCH 6/6] Add more migrations to wait --- scripts/upgrade | 54 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 250852c..32bd2ee 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -317,20 +317,48 @@ then # https://docs.gitlab.com/ee/update/#checking-for-background-migrations-before-upgrading if dpkg --compare-versions "$current_version" "ge" "12.9"; then - - counter=0 - while ! gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining' - do - counter=$((counter + 1)) - if [ $counter -gt 1200 ] - then - ynh_print_warn --message="Timeout: a background migration runs for at least 20min !" - break - fi - ynh_print_info --message="Wait for the migration in the background to finish" - sleep 1 - done + checkBackgroundMigration=1 + else + checkBackgroundMigration=0; fi + if dpkg --compare-versions "$current_version" "ge" "14.0"; then + checkDBBackgroundMigration=1 + else + checkDBBackgroundMigration=0; + fi + if dpkg --compare-versions "$current_version" "ge" "14.7"; then + checkBatchedBackgroundMigration=1 + else + checkBatchedBackgroundMigration=0; + fi + + counter=0 + while [ $checkBackgroundMigration -eq 1 ] || [ $checkDBBackgroundMigration -eq 1 ] || [ $checkBatchedBackgroundMigration -eq 1 ] + do + counter=$((counter + 1)) + if [ $counter -gt 1200 ] + then + ynh_print_warn --message="Timeout: a background migration runs for at least 20min !" + break + fi + + if [ $checkBackgroundMigration -eq 1 ] && gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining' | grep -q -w 0 + then + checkBackgroundMigration=0 + fi + + if [ $checkDBBackgroundMigration -eq 1 ] && gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigrationJob.pending' | wc -l | grep -q -w 0 + then + checkDBBackgroundMigration=0 + fi + + if [ $checkBatchedBackgroundMigration -eq 1 ] && echo "select COUNT(*) from batched_background_migrations where status <> 3;" | gitlab-psql -t -A | grep -q -w 0 + then + checkBatchedBackgroundMigration=0 + fi + ynh_print_info --message="Wait for the migration in the background to finish" + sleep 1 + done done fi