#!/bin/sh
rm -rf mattermost
mkdir mattermost
git clone --depth 1 https://github.com/mattermost/mattermost-server.git mattermost/src/github.com/mattermost/mattermost-server -b v5.7.1
#git clone --depth 1 https://github.com/mattermost/mattermost-webapp.git mattermost/src/github.com/mattermost/mattermost-webapp -b v5.7.1
#( cd mattermost/src/github.com/mattermost/mattermost-webapp/
#  npm install --ignore-scripts
#)
tar cf - --exclude .git mattermost | xz -9 >mattermost-`date '+%Y%m%d'`.tar.xz
rm -rf mattermost
