From e6546359be2de66abd694949711e8cd27a14dbe4 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 2 Aug 2022 10:16:05 +0200 Subject: [PATCH 1/3] 15.2.2 --- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index 69f5438..2d645b6 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "GitLab", "id": "gitlab", "packaging_format": 1, - "version": "15.2.0~ynh1", + "version": "15.2.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 2065ffd..0a89e7e 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,17 +1,17 @@ #!/bin/bash -gitlab_version="15.2.0" +gitlab_version="15.2.2" # sha256sum found here: https://packages.gitlab.com/gitlab gitlab_debian_version="$(lsb_release -sc)" -gitlab_x86_64_bullseye_source_sha256="6389276f340fc7992030e9da6d8689bbc064413344b3336b2c00e2082ec3ec70" -gitlab_x86_64_buster_source_sha256="6288ca86bdfcf0300a22025fd804ec4a0360a0cbfe8f82a90c510589d5effa5b" +gitlab_x86_64_bullseye_source_sha256="d2a65650a15eb25c4a0c80e09db85edb31c99f54bdee751e6201c3977bd5058e" +gitlab_x86_64_buster_source_sha256="27b1e6ea735ea64cb534b25eb1ec2b0c672002e6fac84cf610a8b13f1573775a" -gitlab_arm64_bullseye_source_sha256="5a43d9fe8d6ecb22af5bea15f29fca6c20d81c3795bc6e5999f8e37ae80c69a5" -gitlab_arm64_buster_source_sha256="8b904fe231a6a10a8991be32202c06e2446dd112b7d97a08f7aa1d24573c168b" +gitlab_arm64_bullseye_source_sha256="46f6623b254ef32ef051a472cd8718ceddf8d1a912f742a1c458aebdc513ccb1" +gitlab_arm64_buster_source_sha256="a60e28b94c3de9540e507fd4522580ff8bc0c17028f5f06cdf81dbf012115753" -gitlab_arm_buster_source_sha256="549250a4515b2f634132f5769fafc747c938995445f2738da511d55827572d61" +gitlab_arm_buster_source_sha256="33147e1ee5281a5bf2f956b8237ee0a1352dab25f3931922e7e22f110884fa00" 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="15.2.0" - gitlab_arm_buster_source_sha256="549250a4515b2f634132f5769fafc747c938995445f2738da511d55827572d61" + gitlab_version="15.2.2" + gitlab_arm_buster_source_sha256="33147e1ee5281a5bf2f956b8237ee0a1352dab25f3931922e7e22f110884fa00" fi gitlab_source_sha256=$gitlab_arm_buster_source_sha256 fi From 17a35afc44a4cd2e676d32a22004817d3bd3fa31 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 2 Aug 2022 15:16:34 +0200 Subject: [PATCH 2/3] new migrations, run migrations before upgrade gitlab --- scripts/upgrade | 95 +++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 32bd2ee..73e86da 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -260,6 +260,55 @@ then # While the current version is not the last version, do an upgrade while [ "$last_version" != "$current_version" ] do + # https://docs.gitlab.com/ee/update/#checking-for-background-migrations-before-upgrading + if dpkg --compare-versions "$current_version" "ge" "12.9"; then + checkBackgroundMigration=1 + else + checkBackgroundMigration=0; + fi + if dpkg --compare-versions "$current_version" "ge" "15.1"; then + checkDBBackgroundMigration=2 + elif 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 -ge 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 2 ] && gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count' | grep -q -w 0 + then + checkDBBackgroundMigration=0 + elif [ $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 current_major_version=${current_version%%.*} @@ -313,52 +362,6 @@ 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 - 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 From 9373686f49efefa76cd5d62b5904436277ac3a1c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 2 Aug 2022 13:17:02 +0000 Subject: [PATCH 3/3] 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 2811bd6..1d17f3b 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:** 15.2.0~ynh1 +**Shipped version:** 15.2.2~ynh1 **Demo:** https://gitlab.com/explore diff --git a/README_fr.md b/README_fr.md index c1a6d73..183a54c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,7 +17,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 :** 15.2.0~ynh1 +**Version incluse :** 15.2.2~ynh1 **Démo :** https://gitlab.com/explore