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

Merge pull request #65 from YunoHost-Apps/app.src

[Fix] Add app.src
This commit is contained in:
Pierre de La Morinerie 2017-10-23 13:54:52 +05:30 committed by GitHub
commit 8a5a7fbcf5
4 changed files with 11 additions and 25 deletions

View file

@ -1 +0,0 @@
4.3.0

6
conf/app.src Normal file
View file

@ -0,0 +1,6 @@
SOURCE_URL=https://releases.mattermost.com/4.3.0/mattermost-4.3.0-linux-amd64.tar.gz
SOURCE_SUM=c21eefaa87fca836e17d874296e67baf181ab5594f705090247614faae219d01
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=

View file

@ -72,8 +72,6 @@ root_path="$(pwd)/.."
final_path="/var/www/$app"
data_path="/home/yunohost.app/$app"
logs_path="/var/log/$app"
version=$(cat "$root_path/VERSION")
archive_filename="mattermost-$version.tar.gz"
#=================================================
# CREATE A MYSQL DATABASE
@ -97,16 +95,12 @@ ynh_app_setting_set mattermost smtppwd "$smtp_password"
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
archive_url="https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz"
ynh_app_setting_set "$app" final_path "$final_path"
ynh_setup_source "$final_path"
sudo mkdir -p "$final_path"
sudo mkdir -p "$data_path"
sudo mkdir -p "$logs_path"
sudo wget --quiet --output-document "$archive_filename" "$archive_url"
sudo tar -xvz --file "$archive_filename" --directory "$final_path" --strip-components 1
sudo rm -f "$archive_filename"
#=================================================
# EDIT MATTERMOST CONFIG
#=================================================

View file

@ -27,8 +27,6 @@ root_path="$(pwd)/.."
final_path="/var/www/$app"
data_path="/home/yunohost.app/$app"
logs_path="/var/log/$app"
version=$(cat "$root_path/VERSION")
archive_filename="mattermost-$version.tar.gz"
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
@ -45,20 +43,11 @@ ynh_clean_setup () {
fi
# Restore the backup
ynh_restore_upgradebackup
# Remove the temporary archive
sudo rm -f "$archive_filename"
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# DOWNLOAD SOURCE
#=================================================
archive_url="https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz"
sudo wget --quiet --output-document "$archive_filename" "$archive_url"
#=================================================
# STOP SERVER
#=================================================
@ -84,13 +73,11 @@ backup_config_file="/tmp/config.json"
sudo cp -f "$config_file" "$backup_config_file"
#=================================================
# COPY NEW CODE
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
sudo rm -rf "$final_path"
sudo mkdir -p "$final_path"
sudo tar -xvz --file "$archive_filename" --directory "$final_path" --strip-components 1
sudo rm -f "$archive_filename"
ynh_app_setting_set "$app" final_path "$final_path"
ynh_setup_source "$final_path"
#=================================================
# RESTORE CONFIGURATION FILE