From c62229004e0a1cae71038354e1e3ac9afc67fc75 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 29 Mar 2021 11:46:48 +0200 Subject: [PATCH] Add arm64 support --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- scripts/upgrade.d/upgrade.last.sh | 4 ++++ upgrade-versions.sh | 10 ++++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index bf5e437..10019b2 100644 --- a/scripts/install +++ b/scripts/install @@ -43,8 +43,8 @@ final_path=/opt/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Detect the system architecture -if [ -n "$(uname -m | grep aarch64)" ]; then - ynh_die "Gitlab is not compatible with arm64 architecture" +if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then + architecture="arm64" elif [ -n "$(uname -m | grep x86_64)" ]; then architecture="x86-64" elif [ -n "$(uname -m | grep 86)" ]; then diff --git a/scripts/upgrade b/scripts/upgrade index d5843ad..478b73b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,8 +76,8 @@ fi # If architecture doesn't exist, create it if [ -z "$architecture" ]; then - if [ -n "$(uname -m | grep aarch64)" ]; then - ynh_die "Gitlab is not compatible with arm64 architecture" + if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then + architecture="arm64" elif [ -n "$(uname -m | grep x86_64)" ]; then architecture="x86-64" elif [ -n "$(uname -m | grep 86)" ]; then diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index fa28cfc..12858e2 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -7,12 +7,16 @@ gitlab_debian_version="buster" gitlab_x86_64_buster_source_sha256="85a02b3fa8bfa5ec2a69ef039e2dd787ad317d920c05b697be314e3e74542190" +gitlab_arm64_buster_source_sha256="fb7a1e4ef95651211f4327cbe1680bdd59c039365f83f1d47a319176f796f824" + gitlab_arm_buster_source_sha256="1613a02e2925af265ddbdf809d3614cc609d7dc037a82f6bdcbf285bf76494dd" architecture=$(ynh_app_setting_get --app="$app" --key=architecture) if [ "$architecture" = "x86-64" ]; then gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256 +elif [ "$architecture" = "arm64" ]; then + gitlab_source_sha256=$gitlab_arm64_buster_source_sha256 elif [ "$architecture" = "arm" ]; then gitlab_source_sha256=$gitlab_arm_buster_source_sha256 fi diff --git a/upgrade-versions.sh b/upgrade-versions.sh index c9895fe..5ddc9b4 100755 --- a/upgrade-versions.sh +++ b/upgrade-versions.sh @@ -24,6 +24,16 @@ echo sha256: $new_sha256 sed -i -e "s/gitlab_x86_64_buster_source_sha256=\".*\"/gitlab_x86_64_buster_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file +# arm64 +url=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/buster/gitlab-ce_$version-ce.0_arm64.deb + +new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs) + +echo url: $url +echo sha256: $new_sha256 + +sed -i -e "s/gitlab_arm64_buster_source_sha256=\".*\"/gitlab_arm64_buster_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file + # arm url=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/buster/gitlab-ce_$version-ce.0_armhf.deb