forked from mohammad-Serpoush/on-air
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.bash
40 lines (31 loc) · 647 Bytes
/
start.bash
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
#!/bin/bash
# Build Go project
go build -o on-air .
# Check if the build was successful
if [ $? -ne 0 ]; then
echo "Build failed. Exiting."
exit 1
fi
# Run migrations
./on-air migrate --state=up
# Check if migration was successful
if [ $? -ne 0 ]; then
echo "Migration failed. Exiting."
exit 1
fi
# Run seed
./on-air seed
# Check if seed was successful
if [ $? -ne 0 ]; then
echo "Seed failed. Exiting."
exit 1
fi
# Run server
./on-air serve
# Check if server failed
if [ $? -ne 0 ]; then
echo "Server failed. Exiting."
exit 1
fi
# Cleanup - Uncomment the line below if you want to remove the built executable
# rm on-air