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

77 lines
3 KiB
Bash
Raw Permalink Normal View History

2020-06-23 13:28:57 +02:00
#!/bin/bash
2024-08-26 23:44:04 +02:00
gitlab_version="17.3.1"
2018-12-16 23:04:05 +01:00
2023-08-28 10:47:02 +02:00
# Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
2020-04-22 19:36:44 +02:00
# sha256sum found here: https://packages.gitlab.com/gitlab
2021-12-23 16:59:08 +01:00
gitlab_debian_version="$(lsb_release -sc)"
2020-04-22 19:36:44 +02:00
2024-08-26 23:44:04 +02:00
gitlab_x86_64_bookworm_source_sha256="62fa53982c28d97d06bf5d472503a75239b71a5084a04899026fe30d94072777"
gitlab_x86_64_bullseye_source_sha256="6e6136eb00fcc63e60af460b332fe9d65c7ecb37e87fd98c2881584206f34f1f"
gitlab_x86_64_buster_source_sha256="68448990a6d12fcd6c24ab22626907cbe17b02f58bc62db8d20759d2193f2a4c"
2020-05-06 11:08:54 +02:00
2024-08-26 23:44:04 +02:00
gitlab_arm64_bookworm_source_sha256="4bb5ba840b53deb9f3779b4ebfbb177852a0bddca8cc0f462b3746a213e3b8bc"
gitlab_arm64_bullseye_source_sha256="a147cbc7339b5f050b5e4a9d3f5bf34eb783313c65dd6c43a813397be58908e0"
gitlab_arm64_buster_source_sha256="868a9e57b39bbb6644afb155ae8bda756bc7381c6ad46821c2c596b3ffe763c3"
2021-03-29 11:46:48 +02:00
2024-08-26 23:44:04 +02:00
gitlab_arm_bookworm_source_sha256="8cd646aa3b8e207559e48904c84792d22d0964524652a8211870845561fe4bd0"
gitlab_arm_bullseye_source_sha256="242bf38fa03de6b3f96e92c578a2a23f8eedc45bf2eefe995b8328c82ebb9151"
gitlab_arm_buster_source_sha256="2e70c86e5b9197ccb57d475521a95511ca35340e5dc1d0d3a67cfe9a959202ad"
architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
2023-07-04 08:27:03 +02:00
# Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection
# ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256
# gitlab_source_sha256=${!ref}
if [ "$architecture" = "x86-64" ]; then
2023-06-30 10:48:19 +02:00
if [ "$gitlab_debian_version" = "bookworm" ]
then
gitlab_source_sha256=$gitlab_x86_64_bookworm_source_sha256
elif [ "$gitlab_debian_version" = "bullseye" ]
2021-12-23 16:59:08 +01:00
then
gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
elif [ "$gitlab_debian_version" = "buster" ]
then
gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
fi
2021-03-29 11:46:48 +02:00
elif [ "$architecture" = "arm64" ]; then
2023-06-30 10:48:19 +02:00
if [ "$gitlab_debian_version" = "bookworm" ]
then
gitlab_source_sha256=$gitlab_arm64_bookworm_source_sha256
elif [ "$gitlab_debian_version" = "bullseye" ]
2021-12-23 16:59:08 +01:00
then
gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
elif [ "$gitlab_debian_version" = "buster" ]
then
gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
fi
elif [ "$architecture" = "arm" ]; then
2023-06-30 10:48:19 +02:00
if [ "$gitlab_debian_version" = "bookworm" ]
2022-10-24 12:09:27 +02:00
then
2023-06-30 10:48:19 +02:00
gitlab_source_sha256=$gitlab_arm_bookworm_source_sha256
if [ -z "$gitlab_arm_bookworm_source_sha256" ]
then
gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
2022-10-24 12:09:27 +02:00
fi
2023-06-30 10:48:19 +02:00
elif [ "$gitlab_debian_version" = "bullseye" ]
2022-10-24 12:09:27 +02:00
then
gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
2023-06-30 10:48:19 +02:00
elif [ "$gitlab_debian_version" = "buster" ]
then
gitlab_source_sha256=$gitlab_arm_buster_source_sha256
2021-07-08 17:16:07 +02:00
fi
2020-06-23 13:28:57 +02:00
fi
2019-03-16 02:38:12 +01:00
2019-03-17 20:14:56 +01:00
gitlab_filename="gitlab-ce-${gitlab_version}.deb"
# Action to do in case of failure of the package_check
package_check_action() {
ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
cat <<EOF >> "$config_path/gitlab.rb"
# Last chance to fix Gitlab
package['modify_kernel_parameters'] = false
EOF
ynh_store_file_checksum --file="$config_path/gitlab.rb"
}