mirror of
https://github.com/azukaar/Cosmos-Server.git
synced 2025-12-18 10:35:49 -06:00
43 lines
1.1 KiB
Bash
43 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
echo " ---- Build Cosmos ----"
|
|
|
|
# Set target architecture for ARM64
|
|
# export GOOS=linux
|
|
# export GOARCH=arm64
|
|
|
|
rm -rf build
|
|
|
|
cp src/update.go src/launcher/update.go
|
|
|
|
go build -o build/cosmos src/*.go
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
go build -o build/cosmos-launcher ./src/launcher/launcher.go ./src/launcher/update.go
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
|
|
echo " ---- Build complete, copy assets ----"
|
|
|
|
cp start.sh build/start.sh
|
|
chmod +x build/start.sh
|
|
chmod +x build/cosmos
|
|
chmod +x build/cosmos-launcher
|
|
|
|
cp -r static build/
|
|
cp -r GeoLite2-Country.mmdb build/
|
|
cp nebula-arm-cert nebula-cert nebula-arm nebula build/
|
|
cp -r Logo.png build/
|
|
cp restic build/
|
|
mkdir build/images
|
|
cp client/src/assets/images/icons/cosmos_gray.png build/cosmos_gray.png
|
|
cp client/src/assets/images/icons/cosmos_gray.png cosmos_gray.png
|
|
echo '{' > build/meta.json
|
|
cat package.json | grep -E '"version"' >> build/meta.json
|
|
echo ' "buildDate": "'`date`'",' >> build/meta.json
|
|
echo ' "built from": "'`hostname`'"' >> build/meta.json
|
|
echo '}' >> build/meta.json
|
|
|
|
echo " ---- copy complete ----" |