-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·83 lines (67 loc) · 2.07 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·83 lines (67 loc) · 2.07 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
82
83
#!/bin/bash
echo """
----------------------------------
___ _ _ _ _ ___ _ _ _ _____ _
| _ ) ___| | (_)_____(_)_ __ ___ | _ )_ _(_) |__| | |_ _|__ ___| |___
| _ \/ -_) | | (_-<_-< | ' \/ _ \ | _ \ || | | / _ | | |/ _ \/ _ \ (_-<
|___/\___|_|_|_/__/__/_|_|_|_\___/ |___/\_,_|_|_\__,_| |_|\___/\___/_/__/
Build and start server for Bellissimo
Automatically configure docker.env and build the binaries
----------------------------------
"""
# If not Linux or macOS
if [ "$(uname)" != "Linux" -a "$(uname)" != "Darwin" ]; then
echo "Only Linux and macOS are supported" >&2
exit 0
fi
echo "Starting build..."
## Build
echo "Building core..."
echo "Do you want to build binaries of bellissimo-core? (y/n)"\
&& read -r answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
## Prebuild
echo "Prebuilding..."
if [ ! -d "plugins" ]; then
echo "🔨 Creating folder 'plugins'..."
mkdir -p plugins || exit
fi
if [ ! -d "public" ]; then
echo "🔨 Creating folder 'public'..."
mkdir -p public || exit
fi
if [ ! -f "config.local.toml" ]; then
echo "🔨 Creating config.local.toml..."
touch config.local.toml || exit
fi
if [ ! -f "plugins.toml" ]; then
echo "🔨 Creating plugins.toml..."
touch plugins.toml || exit
fi
echo "🔨 Building bin..."
docker compose build
fi
echo "Building Web..."
echo "Do you want to build web of bellissimo? (y/n)"\
&& read -r answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
cd web || exit
npm install -force || exit
npm run build || exit
cd ..
fi
if [ ! -f "docker.env" ]; then
echo "🔨 Creating docker.env..."
echo "Do you want continue? (y/n)"\
&& read -r answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
/bin/bash configure.sh
fi
fi
echo "Do you want to start server? (y/n)"\
&& read -r answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
echo "🚀 Starting server..."
/bin/bash start.sh
fi
echo "Done!"