-
Notifications
You must be signed in to change notification settings - Fork 0
/
feline.sh
executable file
·58 lines (50 loc) · 1.9 KB
/
feline.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#! /bin/bash
# File: feline.sh
# Author: Gael Marcadet <gael.marcadet@limos.fr>
# Description: Launch the FELINE demo.
# stop on failure
set -e
# checks the required dependancies
if [[ -z $(which docker) || -z $(which docker-compose) ]]; then
read -p "Docker is currently not installed, can I do it for you?" -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
sudo apt-get update
read -p "Have you already install docker on this computer?" -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
fi
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
echo "Everything is installed. I now execute a command to check if docker is running correctly."
sudo docker run hello-world
fi
else
echo "Docker and Docker-composer are installed."
fi
# if not data folder in the location, download it
if [[ ! -e linear-api/data ]]; then
echo "I cannot see the data folder (./linear-api/data), so I will download it from a drive."
cd linear-api
./download-data.sh
cd ..
else
echo "The data folder (./linear-api/data) has been localized."
fi
# launch FELINE
if [ -e "docker-compose.yml" ]; then
rm docker-compose.yml
fi
if [[ "$1" == '--prod' ]]; then
echo "Launching FELINE in production mode"
ln -s docker-compose-prod.yml docker-compose.yml
else
echo "Launching FELINE in development mode"
ln -s docker-compose-dev.yml docker-compose.yml
fi
docker-compose up