-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
55 lines (47 loc) · 1.28 KB
/
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
48
49
50
51
52
53
54
55
#!/bin/bash
# Aenzbi Setup Script
echo "Starting Aenzbi setup..."
# Check if Node.js is installed
if ! [ -x "$(command -v node)" ]; then
echo "Node.js is not installed. Installing Node.js..."
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
else
echo "Node.js is already installed."
fi
# Check if Git is installed
if ! [ -x "$(command -v git)" ]; then
echo "Git is not installed. Installing Git..."
sudo apt-get install -y git
else
echo "Git is already installed."
fi
# Clone the Aenzbi repository
if [ ! -d "aenzbi" ]; then
echo "Cloning Aenzbi repository..."
git clone https://github.com/allyelvis/aenzbi.git
else
echo "Repository already cloned. Pulling latest changes..."
cd aenzbi
git pull
cd ..
fi
# Navigate to the project directory
cd aenzbi || exit
# Install dependencies
echo "Installing dependencies..."
npm install
# Create .env file if it doesn't exist
if [ ! -f ".env" ]; then
echo "Creating .env file..."
cat <<EOT >>.env
API_BASE_URL=https://ebms.obr.gov.bi:9443/ebms_api
BEARER_TOKEN=your_token_here
PORT=3000
EOT
echo ".env file created. Please update it with your credentials."
else
echo ".env file already exists."
fi
# Complete
echo "Setup is complete. Run 'npm start' to launch the application."