From 6f24a90e47d3c44e26032563ec32be103bebee3d Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Sat, 31 Oct 2015 18:00:13 +0100 Subject: [PATCH] Download compiled binaries at install time And avoid including compiled binaries in the source tree. The previously committed binaries have been removed from the git history. Fix #1 --- VERSION | 1 + scripts/install | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..56130fb --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +v1.1.1 diff --git a/scripts/install b/scripts/install index 4621bdc..8394787 100644 --- a/scripts/install +++ b/scripts/install @@ -52,6 +52,7 @@ function exit_properly sudo userdel mattermost sudo rm -Rf /var/www/mattermost + rm "mattermost.tar.gz" exit 1 } trap exit_properly ERR @@ -61,13 +62,17 @@ smtp_password=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za- sudo useradd -M --shell /bin/false -p $(openssl passwd -1 "$smtp_password") "mattermost" sudo yunohost app setting mattermost smtppwd -v $smtp_password -# Install sources +# Download and install code root_path=$(pwd)/.. final_path=/var/www/mattermost data_path=/home/yunohost.app/mattermost sudo mkdir -p $final_path sudo mkdir -p $data_path -sudo cp -af $root_path/sources/. $final_path + +version=$(cat $root_path/VERSION) +wget -q "https://github.com/mattermost/platform/releases/download/${version}/mattermost.tar.gz" +sudo tar -xvz --file "mattermost.tar.gz" --directory $final_path --strip-components 1 +rm -f "mattermost.tar.gz" # Change variables in Mattermost config db_connection_url="${db_user}:${db_password}@tcp(127.0.0.1:3306)/${db_name}?charset=utf8mb4,utf8"