1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00
This commit is contained in:
ericgaspar 2021-10-13 15:54:00 +02:00
parent 645bd66a2d
commit a34ddfe26e
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 5 additions and 30 deletions

View file

@ -1,7 +0,0 @@
SOURCE_URL=https://golang.org/dl/go1.15.8.linux-amd64.tar.gz
SOURCE_SUM=d3379c32a90fdf9382166f8f48034c459a8cc433730bc9476d39d9082c94583b
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=
SOURCE_EXTRACT=true

View file

@ -163,35 +163,17 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=2
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
#=================================================
# INSTALL MMCTL
#=================================================
# Install Go if needed
if ! command -v /usr/local/go/bin/go &> /dev/null
then
ynh_script_progression --message="Installing Go dependency... (this will take some time)" --weight=3
ynh_setup_source --source_id="go" --dest_dir="/usr/local/"
fi
export PATH=$PATH:/usr/local/go/bin
env_path=$PATH
go get -u github.com/mattermost/mmctl
source <(mmctl completion bash)
#================================================= #=================================================
# CREATE ADMIN AND FIRST TEAM # CREATE ADMIN AND FIRST TEAM
#================================================= #=================================================
team_name=$(echo "$team_display_name" | iconv -f utf8 -t ascii//TRANSLIT//IGNORE | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z) team_name=$(echo "$team_display_name" | iconv -f utf8 -t ascii//TRANSLIT//IGNORE | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z)
pushd "$final_path" pushd "$final_path/bin"
ynh_exec_warn_less ynh_exec_as $app bin/mattermost mmctl user create --username "$admin" --email "$email" --password "$password" --locale "$language" --system_admin ynh_exec_warn_less ynh_exec_as $app mmctl user create --username "$admin" --email "$email" --password "$password" --locale "$language" --system_admin
ynh_exec_warn_less ynh_exec_as $app bin/mattermost mmctl user verify "$admin" ynh_exec_warn_less ynh_exec_as $app mmctl user verify "$admin"
ynh_exec_warn_less ynh_exec_as $app bin/mattermost mmctl team create --name "$team_name" --display_name "$team_display_name" --email "$email" ynh_exec_warn_less ynh_exec_as $app mmctl team create --name "$team_name" --display_name "$team_display_name" --email "$email"
ynh_exec_warn_less ynh_exec_as $app bin/mattermost mmctl team add "$team_name" "$admin" ynh_exec_warn_less ynh_exec_as $app mmctl team add "$team_name" "$admin"
popd popd
#================================================= #=================================================