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

Merge pull request #172 from YunoHost-Apps/testing

Testing
This commit is contained in:
Kayou 2021-12-27 01:28:26 +01:00 committed by GitHub
commit 4215b6bcab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 72 additions and 43 deletions

View file

@ -15,9 +15,9 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview
Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features.
Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features
**Shipped version:** 14.5.0~ynh1
**Shipped version:** 14.6.0~ynh1
**Demo:** https://gitlab.com/explore

View file

@ -11,9 +11,9 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
## Vue d'ensemble
Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD.
Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD
**Version incluse :** 14.5.0~ynh1
**Version incluse :** 14.6.0~ynh1
**Démo :** https://gitlab.com/explore

View file

@ -682,6 +682,7 @@ gitlab_rails['gitlab_shell_ssh_port'] = __SSH_PORT__
# gitlab_rails['extra_google_analytics_id'] = '_your_tracking_id'
# gitlab_rails['extra_google_tag_manager_id'] = '_your_tracking_id'
# gitlab_rails['extra_one_trust_id'] = '_your_one_trust_id'
# gitlab_rails['extra_google_tag_manager_nonce_id'] = '_your_google_tag_manager_id'
# gitlab_rails['extra_matomo_url'] = '_your_matomo_url'
# gitlab_rails['extra_matomo_site_id'] = '_your_matomo_site_id'
# gitlab_rails['extra_matomo_disable_cookies'] = false
@ -1073,11 +1074,19 @@ puma['port'] = __PUMA_PORT__
# sidekiq['negate'] = false
##! Specifies where Prometheus metrics endpoints should be made available for Sidekiq processes.
# sidekiq['metrics_enabled'] = true
# sidekiq['exporter_log_enabled'] = false
# sidekiq['listen_address'] = "localhost"
sidekiq['listen_port'] = __SIDEKIQ_PORT__
##! Specifies where health-check endpoints should be made available for Sidekiq processes.
##! Defaults to the same settings as for Prometheus metrics (see above).
# sidekiq['health_checks_enabled'] = true
# sidekiq['health_checks_log_enabled'] = false
# sidekiq['health_checks_listen_address'] = "localhost"
# sidekiq['health_checks_listen_port'] = 8082
##! Service name used to register Sidekiq as a Consul service
# sidekiq['consul_service_name'] = 'sidekiq'
##! Semantic metadata used when registering Sidekiq as a Consul service

View file

@ -7,7 +7,7 @@ name = "GitLab configuration"
name = "Overwriting config files"
[main.overwrite_files.overwrite_nginx]
ask = "Overwrite the nginx config file ?"
ask = "Overwrite the NGINX config file?"
type = "boolean"
help = "If the file is overwritten, a backup will be created."
@ -15,5 +15,5 @@ name = "GitLab configuration"
name = "External users"
[main.users.use_web_account]
ask = "Authorized external user creation ?"
ask = "Authorized external user creation?"
type = "boolean"

View file

@ -2,10 +2,10 @@
"name": "GitLab",
"id": "gitlab",
"packaging_format": 1,
"version": "14.5.0~ynh1",
"version": "14.6.0~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."
"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"
},
"url": "https://gitlab.com",
"upstream": {
@ -46,8 +46,8 @@
"name": "is_public",
"type": "boolean",
"help": {
"en": "If your Gitlab instance is public, anyone can see your public repositories.",
"fr": "Si votre instance Gitlab est publique, tout le monde pourra voir vos dépôts publics."
"en": "If your GitLab instance is public, anyone can see your public repositories.",
"fr": "Si votre instance GitLab est publique, tout le monde pourra voir vos dépôts publics."
},
"default": true
},

View file

@ -1,27 +1,42 @@
#!/bin/bash
gitlab_version="14.5.0"
gitlab_version="14.6.0"
# sha256sum found here: https://packages.gitlab.com/gitlab
gitlab_debian_version="buster"
gitlab_debian_version="$(lsb_release -sc)"
gitlab_x86_64_buster_source_sha256="9665cde5950fb531bde2c585fbab6a76e6a9677868dc573d6435003b580833d4"
gitlab_x86_64_bullseye_source_sha256="d58b5f7dc1a435d57d74e8540c2c646c12b708085b2aa077fbdfb14eff13b629"
gitlab_x86_64_buster_source_sha256="2321f763edd9142a018e20e5029289528ef84769f20b8077acc85e6712aafb12"
gitlab_arm64_buster_source_sha256="bb0372c1fe0aa8f7f741c3e0b709374309a1aa82462c391be4800fca189d209e"
gitlab_arm64_bullseye_source_sha256="2502431a6edd723a6c3bdcc3243961aaeb3f4225c2e5a7ea3b9251489496b517"
gitlab_arm64_buster_source_sha256="8a0da4655f67f205d265eba205b3913bc07bc47d95a3f8e882024839c461cadc"
gitlab_arm_buster_source_sha256="9c7b3bf6704f4937d69ec7a5f3abeda2fcfe59721887d1012be3bca472cc13e7"
gitlab_arm_buster_source_sha256="0548d379352465793f0c201f745486bf9c88d9952073a8fd46b005bf62f71c68"
architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
if [ "$architecture" = "x86-64" ]; then
if [ "$gitlab_debian_version" = "bullseye" ]
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
elif [ "$architecture" = "arm64" ]; then
if [ "$gitlab_debian_version" = "bullseye" ]
then
gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
elif [ "$gitlab_debian_version" = "buster" ]
then
gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
fi
gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
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.5.0"
gitlab_arm_buster_source_sha256="9c7b3bf6704f4937d69ec7a5f3abeda2fcfe59721887d1012be3bca472cc13e7"
gitlab_version="14.6.0"
gitlab_arm_buster_source_sha256="0548d379352465793f0c201f745486bf9c88d9952073a8fd46b005bf62f71c68"
fi
gitlab_source_sha256=$gitlab_arm_buster_source_sha256
fi

View file

@ -8,6 +8,7 @@
# Example: ./upgrade-versions.sh scripts/upgrade.d/upgrade.last.sh 13.3.1
file=$(basename $1)
debian_versions=("buster" "bullseye")
version=$2
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
gitlab_directory="$( cd "$( dirname "$current_dir/$1" )/../../" >/dev/null 2>&1 && pwd )"
@ -15,42 +16,46 @@ gitlab_directory="$( cd "$( dirname "$current_dir/$1" )/../../" >/dev/null 2>&1
# Only replace the first occurrence
sed -i -e "0,/gitlab_version=\"[^0-9.]*[0-9.]*[0-9.]\"/s//gitlab_version=\"$version\"/" $gitlab_directory/scripts/upgrade.d/$file
# x86_64
url=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/buster/gitlab-ce_$version-ce.0_amd64.deb
for debian_version in "${debian_versions[@]}"
do
new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs)
# x86_64
url=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/${debian_version}/gitlab-ce_$version-ce.0_amd64.deb
echo url: $url
echo sha256: $new_sha256
new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs)
sed -i -e "s/gitlab_x86_64_buster_source_sha256=\".*\"/gitlab_x86_64_buster_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
echo url: $url
echo sha256: $new_sha256
# arm64
url=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/buster/gitlab-ce_$version-ce.0_arm64.deb
sed -i -e "s/gitlab_x86_64_${debian_version}_source_sha256=\".*\"/gitlab_x86_64_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs)
# arm64
url=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/${debian_version}/gitlab-ce_$version-ce.0_arm64.deb
echo url: $url
echo sha256: $new_sha256
new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs)
sed -i -e "s/gitlab_arm64_buster_source_sha256=\".*\"/gitlab_arm64_buster_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
echo url: $url
echo sha256: $new_sha256
# arm
url=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/buster/gitlab-ce_$version-ce.0_armhf.deb
sed -i -e "s/gitlab_arm64_${debian_version}_source_sha256=\".*\"/gitlab_arm64_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs)
# arm
url=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/${debian_version}/gitlab-ce_$version-ce.0_armhf.deb
echo url: $url
echo sha256: $new_sha256
new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs)
# Only replace the first occurrence
sed -i -e "0,/gitlab_arm_buster_source_sha256=\".*\"/s//gitlab_arm_buster_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
echo url: $url
echo sha256: $new_sha256
# if new_sha256 exists for arm, then replace the backup version/sha256 for this arch
if [ -n "$new_sha256" ]; then
# Only replace the first occurrence
sed -i -e "0,/gitlab_arm_${debian_version}_source_sha256=\".*\"/s//gitlab_arm_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
# if new_sha256 exists for arm, then replace the backup version/sha256 for this arch
if [ -n "$new_sha256" ]; then
sed -i -e "s/gitlab_version=\"[^0-9.]*[0-9.]*[0-9.]\"/gitlab_version=\"$version\"/" $gitlab_directory/scripts/upgrade.d/$file
sed -i -e "s/gitlab_arm_buster_source_sha256=\".*\"/gitlab_arm_buster_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
fi
sed -i -e "s/gitlab_arm_${debian_version}_source_sha256=\".*\"/gitlab_arm_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
fi
done
if [[ "$(basename $file)" == upgrade.last.sh ]]; then