-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlinux-setup.sh
executable file
·47 lines (38 loc) · 1.24 KB
/
linux-setup.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
#!/bin/bash
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "Error: Docker is not installed. Please install Docker before running this script."
exit 1
fi
# Check if yarn is installed
if ! command -v yarn &> /dev/null; then
echo "Yarn is not installed. Installing Yarn using npm..."
npm install -g yarn
# Check if yarn installation was successful
if [ $? -ne 0 ]; then
echo "Error: Yarn installation failed. Please check the installation and try again."
exit 1
fi
echo "Yarn installed successfully."
fi
# Run Docker Compose
echo "Running Docker Compose..."
sudo docker-compose down
sudo docker-compose up -d
# Check if Docker Compose execution was successful
if [ $? -ne 0 ]; then
echo "Error: Docker Compose execution failed. Please check the configuration and try again."
exit 1
fi
# Install packages using yarn
echo "Installing project dependencies using yarn..."
yarn install
# Check if yarn install was successful
if [ $? -ne 0 ]; then
echo "Error: Yarn install failed. Please check the installation and try again."
exit 1
fi
echo "Migrating Database..."
rm -rfv ./src/migrations
yarn run migration:generate ./src/migrations/initialMigration
yarn run migration:run