1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00

Merge remote-tracking branch 'origin/testing' into v2

This commit is contained in:
Éric Gaspar 2023-03-07 08:48:15 +01:00
commit 83ed7cc55f
10 changed files with 46 additions and 27 deletions

View file

@ -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=""

View file

@ -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

View file

@ -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

View file

@ -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

6
conf/team_arm64.src Normal file
View file

@ -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

View file

@ -34,10 +34,10 @@ ynh_script_progression --message="Setting up source files..." --weight=3
if [ "$version" = "Enterprise" ]; then
# Get Enterprise binary path
ynh_setup_source --dest_dir="$install_dir" --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="$install_dir" --source_id="$YNH_ARCH"
ynh_setup_source --dest_dir="$final_path" --source_id="team_$YNH_ARCH"
fi
chown -R $app:www-data "$install_dir"

View file

@ -97,9 +97,9 @@ then
ynh_secure_remove --file="$install_dir"
if [ "$version" = "Enterprise" ]; then
ynh_setup_source --dest_dir="$install_dir" --source_id="enterprise"
ynh_setup_source --dest_dir="$final_path" --source_id="enterprise_$YNH_ARCH"
elif [ "$version" = "Team" ]; then
ynh_setup_source --dest_dir="$install_dir" --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