-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
74 lines (65 loc) · 2.17 KB
/
entrypoint.sh
File metadata and controls
74 lines (65 loc) · 2.17 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
#!/bin/bash
set -euo pipefail
echo "
:=+****#**=.
:+*==-=+++***#+.
+*=---+**+++++**#=
=*-----+*++++++++*%-
.#------=+**++++++**%
.:==*#-------==++*+**###%+=-:
-++=--=#----------=*##+=-----=+++:
.*+-:::::#+---------+#=------------*+
.#=:::::::-#+-------*#---------------+*
*+:::::::::-*#+=---=#-----------------++
%-::::::::-==+*#*++##==--------======--%
%+-::::::-++++=+++*%*++**+----=========%
*#=======++++++++=+%=----+**=========-**
**=++++++++++++=+#+-------+#=======-+#.
+#++==+++++==+*#+---------+#======**.
:+***+++++**##+=----------#+=++*+:
:-=+%##**+++++=--------#*==:.
%*+++++++**+=------#.
-%+++++++++*+-----*=
=#*+++++++*=---=*=
.+#**++++=--=*+:
.=**#****+=:
"
echo -e "\033[1m\033[36mStarting RP Web Container 🚀\033[0m"
mkdir -p /shared/logs
# Define workspaces (set via env vars)
declare -A WORKSPACES=(
["hype"]="$BUILD_HYPE"
["admin"]="$BUILD_ADMIN"
["info"]="$BUILD_INFO"
["site"]="$BUILD_SITE"
["sponsor"]="$BUILD_SPONSOR"
["dashboard"]="$BUILD_DASHBOARD"
)
# Function to check command success
check_status() {
if [ $? -eq 0 ]; then
echo -e "\033[32m✓ $1\033[0m"
else
echo -e "\033[31m✗ $1 failed\033[0m"
return 1
fi
}
# Setup web dependencies
echo -e "\033[1mInstalling root web dependencies...\033[0m"
cd /shared
yarn install
check_status "Yarn install"
yarn prepare || echo "No prepare step found"
check_status "Yarn prepare"
# Start requested workspaces
for workspace in "${!WORKSPACES[@]}"; do
if [[ "${WORKSPACES[$workspace]}" == "true" ]]; then
echo -e "\033[1mStarting @rp/$workspace...\033[0m"
mkdir -p "/shared/logs/$workspace"
setsid bash -c "yarn workspace @rp/$workspace dev --host 2>&1 | tee /shared/logs/$workspace/$workspace.log" &
check_status "@rp/$workspace started"
fi
done
echo -e "\033[1m\033[32mAll requested web workspaces launched 🎉\033[0m"
echo -e "\033[1mLogs at: /shared/logs/\033[0m"
exec bash