From 386cdb633de91aaef934d989535a45bc6ce61633 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 7 Mar 2023 08:46:42 +0100 Subject: [PATCH] Change arm64 source (#409) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add entreprise for arm64, use the official build for arm64 * Auto-update README * update auto-updater script --------- Co-authored-by: yunohost-bot Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- .github/workflows/updater.sh | 21 +++++++++------ README.md | 2 +- README_fr.md | 2 +- bump-mattermost.rb | 26 ++++++++++++------- conf/arm64.src | 6 ----- conf/{enterprise.src => enterprise_amd64.src} | 0 conf/enterprise_arm64.src | 6 +++++ conf/{amd64.src => team_amd64.src} | 0 conf/team_arm64.src | 6 +++++ conf/{armhf.src => team_armhf.src} | 0 doc/DISCLAIMER.md | 2 +- doc/DISCLAIMER_fr.md | 2 +- scripts/install | 4 +-- scripts/upgrade | 4 +-- 14 files changed, 50 insertions(+), 31 deletions(-) delete mode 100644 conf/arm64.src rename conf/{enterprise.src => enterprise_amd64.src} (100%) create mode 100644 conf/enterprise_arm64.src rename conf/{amd64.src => team_amd64.src} (100%) create mode 100644 conf/team_arm64.src rename conf/{armhf.src => team_armhf.src} (100%) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 91bc692..8a84226 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -26,10 +26,12 @@ if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then version=${version:1} fi -# x86-64 and enterprise assets are hosted on Mattermost's servers. +# x86-64 team, x86-64 enterprise, ARM64 team and ARM64 enterprise assets are hosted on Mattermost's servers. assets=() assets+=("https://releases.mattermost.com/$version/mattermost-team-$version-linux-amd64.tar.gz") assets+=("https://releases.mattermost.com/$version/mattermost-enterprise-$version-linux-amd64.tar.gz") +assets+=("https://releases.mattermost.com/$version/mattermost-team-$version-linux-arm64.tar.gz") +assets+=("https://releases.mattermost.com/$version/mattermost-enterprise-$version-linux-arm64.tar.gz") # ARM and ARM64 are published in another repository (with a leading "v" for version tags) other_repo="SmartHoneybee/ubiquitous-memory" @@ -79,16 +81,19 @@ echo "Handling asset at $asset_url" # Leave $src empty to ignore the asset case $asset_url in *"mattermost-"*"-linux-arm.tar.gz") - src="armhf" + src="team_armhf" ;; - *"mattermost-"*"-linux-arm64.tar.gz") - src="arm64" - ;; - *"mattermost-team-"*"-linux-amd64.tar.gz") - src="amd64" + *"mattermost-team-"*"-linux-arm64.tar.gz") + src="team_arm64" ;; *"mattermost-enterprise-"*"-linux-amd64.tar.gz") - src="enterprise" + src="enterprise_amd64" + ;; + *"mattermost-team-"*"-linux-amd64.tar.gz") + src="team_amd64" + ;; + *"mattermost-enterprise-"*"-linux-amd64.tar.gz") + src="enterprise_amd64" ;; *) src="" diff --git a/README.md b/README.md index 3f2c7ca..08dc734 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Mattermost Mobile and Desktop Apps are available [here](https://mattermost.com/d ## Additional information -* This package can by installed on `ARM`, `ARM64` and `x86-64` architecture (only `x86-64` if you choose to install the *Entreprise Edition*). +* This package can by installed on `ARM`, `ARM64` and `x86-64` architecture (only `x86-64` and `ARM64` if you choose to install the *Entreprise Edition*). ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 4e1944f..341ed50 100644 --- a/README_fr.md +++ b/README_fr.md @@ -59,7 +59,7 @@ Ce paquet peut installer la version [*Entreprise Edition*](https://docs.mattermo ## Informations additionnelles -Ce paquet peut être installé sur les architectures `ARM`, `ARM64` et `x86-64` (mais uniquement `x86-64` si vous choisissez d'installer la version *Enterprise Edition*). +Ce paquet peut être installé sur les architectures `ARM`, `ARM64` et `x86-64` (mais uniquement `x86-64` et `ARM64` si vous choisissez d'installer la version *Enterprise Edition*). ## Documentations et ressources diff --git a/bump-mattermost.rb b/bump-mattermost.rb index 34f8f13..b5d5f05 100755 --- a/bump-mattermost.rb +++ b/bump-mattermost.rb @@ -36,9 +36,9 @@ module Mattermost def retrieve_release_data case @variant - when :amd64, :enterprise + when :team_amd64, :team_arm64, :enterprise_amd64, :enterprise_arm64 retrieve_first_party_release_data - when :armhf, :arm64 + when :team_armhf retrieve_smart_honeybee_release_data else raise "Unsupported variant '{#release_desc.variant}'" @@ -47,21 +47,29 @@ module Mattermost def retrieve_first_party_release_data edition = { - amd64: 'team', - enterprise: 'enterprise' + team_amd64: 'team', + team_arm64: 'team', + enterprise_amd64: 'enterprise', + enterprise_arm64: 'enterprise' }.fetch(variant) - @url = "https://releases.mattermost.com/#{version}/mattermost-#{edition}-#{version}-linux-amd64.tar.gz" + arch = { + team_amd64: 'amd64', + team_arm64: 'arm64', + enterprise_amd64: 'amd64', + enterprise_arm64: 'arm64' + }.fetch(variant) - puts "Downloading release #{version}-#{variant} for computing checksum…" + @url = "https://releases.mattermost.com/#{version}/mattermost-#{edition}-#{version}-linux-#{arch}.tar.gz" + + puts "Downloading release #{version}-#{edition}-#{arch} for computing checksum…" release_file = URI.parse(@url).read @sum = Digest::SHA256.hexdigest(release_file) end def retrieve_smart_honeybee_release_data arch = { - armhf: 'arm', - arm64: 'arm64' + team_armhf: 'arm', }.fetch(variant) @url = "https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v#{version}/mattermost-v#{version}-linux-#{arch}.tar.gz" @@ -127,7 +135,7 @@ if version.nil? abort("ERROR: The Mattermost release version must be provided.\nExample: ./bump-mattermost.sh 5.33.1") end -VARIANTS = %i[amd64 enterprise armhf arm64] +VARIANTS = %i[team_amd64 enterprise_amd64 enterprise_arm64 team_arm64 team_armhf] # Compute releases URLs and sums releases = VARIANTS diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index c8c4ece..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v7.5.2/mattermost-v7.5.2-linux-arm64.tar.gz -SOURCE_SUM=85fac79f33d83b7f95b2532a055bbebecb28c60d6c1d955d9613de698d69b29e -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=mattermost.tar.gz diff --git a/conf/enterprise.src b/conf/enterprise_amd64.src similarity index 100% rename from conf/enterprise.src rename to conf/enterprise_amd64.src diff --git a/conf/enterprise_arm64.src b/conf/enterprise_arm64.src new file mode 100644 index 0000000..9937231 --- /dev/null +++ b/conf/enterprise_arm64.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://releases.mattermost.com/7.5.2/mattermost-enterprise-7.5.2-linux-arm64.tar.gz +SOURCE_SUM=2aa9aaf3d599a38682dbb9a2c76b277c85976dd0d331f2d563b51dd58ac141aa +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=mattermost.tar.gz diff --git a/conf/amd64.src b/conf/team_amd64.src similarity index 100% rename from conf/amd64.src rename to conf/team_amd64.src diff --git a/conf/team_arm64.src b/conf/team_arm64.src new file mode 100644 index 0000000..dd10985 --- /dev/null +++ b/conf/team_arm64.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://releases.mattermost.com/7.5.2/mattermost-team-7.5.2-linux-arm64.tar.gz +SOURCE_SUM=39281870a69eccd7876f3c25c69ffae2b87a6920519b74a8eed25c553e06e80c +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=mattermost.tar.gz \ No newline at end of file diff --git a/conf/armhf.src b/conf/team_armhf.src similarity index 100% rename from conf/armhf.src rename to conf/team_armhf.src diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 6ad5870..e0fa03b 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -15,4 +15,4 @@ Mattermost Mobile and Desktop Apps are available [here](https://mattermost.com/d ## Additional information -* This package can by installed on `ARM`, `ARM64` and `x86-64` architecture (only `x86-64` if you choose to install the *Entreprise Edition*). +* This package can by installed on `ARM`, `ARM64` and `x86-64` architecture (only `x86-64` and `ARM64` if you choose to install the *Entreprise Edition*). diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 385d4bb..cd3857e 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -13,4 +13,4 @@ Ce paquet peut installer la version [*Entreprise Edition*](https://docs.mattermo ## Informations additionnelles -Ce paquet peut être installé sur les architectures `ARM`, `ARM64` et `x86-64` (mais uniquement `x86-64` si vous choisissez d'installer la version *Enterprise Edition*). +Ce paquet peut être installé sur les architectures `ARM`, `ARM64` et `x86-64` (mais uniquement `x86-64` et `ARM64` si vous choisissez d'installer la version *Enterprise Edition*). diff --git a/scripts/install b/scripts/install index cfb1a3c..2416b9c 100644 --- a/scripts/install +++ b/scripts/install @@ -104,10 +104,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path if [ "$version" = "Enterprise" ]; then # Get Enterprise binary path - ynh_setup_source --dest_dir="$final_path" --source_id="enterprise" + ynh_setup_source --dest_dir="$final_path" --source_id="enterprise_$YNH_ARCH" elif [ "$version" = "Team" ]; then # Get Team binary path - ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" + ynh_setup_source --dest_dir="$final_path" --source_id="team_$YNH_ARCH" fi chmod 750 "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index 60e9cd8..da97e36 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -157,9 +157,9 @@ then ynh_secure_remove --file="$final_path" if [ "$version" = "Enterprise" ]; then - ynh_setup_source --dest_dir="$final_path" --source_id="enterprise" + ynh_setup_source --dest_dir="$final_path" --source_id="enterprise_$YNH_ARCH" elif [ "$version" = "Team" ]; then - ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" + ynh_setup_source --dest_dir="$final_path" --source_id="team_$YNH_ARCH" fi # Copy the admin saved settings and plugins from tmp directory to final path