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/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/scripts/install b/scripts/install index 075b83c..171395b 100644 --- a/scripts/install +++ b/scripts/install @@ -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" diff --git a/scripts/upgrade b/scripts/upgrade index e99ce8d..ba798ee 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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