-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.sh
executable file
·37 lines (28 loc) · 1.16 KB
/
build.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
#!/bin/bash
if [ ! -f "RELEASE" ]; then
echo "Error: RELEASE file not found"
exit 1
else
echo "Start building"
fi
version=$(cat RELEASE)
echo "Current version: $version"
# Log files for each job
ENGINE_LOG="logs/engine_build.log"
WEB_LOG="logs/web_build.log"
# Start to build web and log output
echo -e "\nStart to build web . . .\n"
(
cd web || exit
docker buildx create --use --name bun-builder --node bun-builder0 --driver docker-container --driver-opt image=moby/buildkit:v0.10.6
docker buildx build --platform linux/arm64,linux/amd64 --tag ifelsedotone/asktube-web:latest --tag ifelsedotone/asktube-web:$version . --push 2>&1 | tee "../$WEB_LOG"
) & # Run in background
# Start to build engine and log output
echo -e "\nStart to build engine . . .\n"
(
cd engine || exit
docker buildx create --use --name py3-builder --node py3-builder0 --driver docker-container --driver-opt image=moby/buildkit:v0.10.6
docker buildx build --platform linux/arm64,linux/amd64 --tag ifelsedotone/asktube-engine:latest --tag ifelsedotone/asktube-engine:$version . --push 2>&1 | tee "../$ENGINE_LOG"
) & # Run in background
wait
echo "Both builds completed."