Merge branch '181-create-an-install-script' into 'master'

Resolve "Create an install script"

Closes #181

See merge request libre.sh/compose.libre.sh!187
This commit is contained in:
Michel Memeteau 2020-02-26 15:58:19 +01:00
commit e928562fce

45
install.linux.sh Normal file → Executable file
View file

@ -1,12 +1,16 @@
#!/bin/bash
#Recommendation : Systemd (debian > 8 , Ubuntu 16.04 , CentOS 7 ...)
#Current version of libre.sh to be installed
LIBRE_VERSION=1.1
# System env vars
## domain handling
### change to your domain vendor ( ovh , online, )
### TODO : Specify you template repo ROOT
TEMPLATES_ROOT=lab.libreho.st/libre.sh/compose/
### TODO : change to your domain vendor ( ovh , online, )
DOMAIN_SERVER=namecheap
### Namecheap specific
@ -40,21 +44,42 @@ MAIL_PORT=587
echo "Welcome to libre.sh installer"
echo "WIP"
echo " setting up system variables"
echo "-------- Welcome to libre.sh $LIBRE_VERSION installer"
# STEP add kernel parameter
echo " Define environnement
# STEP Define environnement
echo "-------- setting up system variables"
# STEP Install Docker
echo "-------- Install latest docker "
# TODO : Fix a version for docker ?
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# STEP "install docker-compose"
echo "-------- Install latest docker-compose "
# TODO : Fix a version for docker compose ?
mkdir -p /opt/bin &&\
dockerComposeVersion=$(curl -s https://api.github.com/repos/docker/compose/releases/latest|grep tag_name|cut -d'"' -f4) &&\
curl -L https://github.com/docker/compose/releases/download/$dockerComposeVersion/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose &&\
chmod +x /opt/bin/docker-compose
# STEP " installing libre.sh"
# STEP install Libre.sh
echo "-------- installing libre.sh"
git clone https://lab.libreho.st/libre.sh/compose.libre.sh /libre.sh
mkdir -p /{data,system}
mkdir -p /data/trash
@ -68,8 +93,8 @@ cp /libre.sh/utils/* /opt/bin/
# STEP add /opt/bin path
echo "3 - updating PATH"
echo "-------- updating PATH"
cat > /etc/profile.d/libre.sh <<EOF
export PATH=$PATH:/opt/bin
EOF
chmod 644 /etc/profile.d/libre.sh
chmod 644 /etc/profile.d/libre.sh