-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.sh
More file actions
executable file
·81 lines (57 loc) · 2.12 KB
/
Copy pathstart-dev.sh
File metadata and controls
executable file
·81 lines (57 loc) · 2.12 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
# Octonius development server
echo -e "\n \t ============================ |- Welcome to Octonius Development Server -| ========================== \n"
echo -e "\t Kindly choose the package manager below to start the application locally(type the option number)..."
echo " 1) yarn"
echo " 2) npm"
read n
case $n in
1) echo "You have selected yarn as your package manager";;
2) echo "You have selected npm as your package manager";;
*) echo "Default option 'yarn' is selected";;
esac
# Package Manager Variable
packageManager="yarn"
# Checking if Selected package manager is npm
if [ "$n" == 2 ]
then
packageManager="npm"
# Else package manager is npm
else
packageManager="yarn"
fi
# Assign Current workdir
mainDir=$PWD
# Go to services directory
cd services
# Define the service Directory array
serviceArray=( 'authentication/server' 'groups/server' 'workspaces/server' 'search/server' 'users/server' 'posts/server' 'notifications/server' 'integrations/server' 'utilities/server' 'folio/server' 'flamingo/server' 'approval/server' 'chats/server' 'client' )
# Loop through all the directories and install the packages
for i in "${serviceArray[@]}"
do
# Slice the name of service from the entire directory name
service="$(cut -d'/' -f1 <<<"$i")"
# If Directory is client
if [ "$i" == 'client' ]
then
cd $mainDir
service="client"
fi
# If Directory is authentication
if [ "$service" == "authentication" ]
then
service="auths"
fi
# Go to service directory
cd $i
# Echo the Status
echo -e "\n \t Starting $service Service..."
# Start the process and push it to background
pm2 start "$packageManager run dev" --name "$service-server" --wait-ready
# Wait for process to get completed
wait
# Echo the status
echo -e "\n \t $service Service has been started successfully!"
# Go back to main working directory(i.e. - services/)
cd -
done