-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·31 lines (22 loc) · 940 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·31 lines (22 loc) · 940 Bytes
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
#!/bin/bash
set -euo pipefail
# Build cron raw package for ZimaOS deployment
# Usage: ./build.sh [arch]
# arch: amd64 (default), arm64
ARCH="${1:-amd64}"
VERSION=$(grep 'version\s*=' cmd/cron/main.go | head -1 | sed 's/.*"\(.*\)".*/\1/')
echo "Building cron v${VERSION} for linux/${ARCH}..."
# 1. Cross-compile Go binary
CGO_ENABLED=0 GOOS=linux GOARCH="${ARCH}" go build \
-ldflags="-s -w" \
-o raw/usr/bin/cron \
./cmd/cron/
echo "Binary built: raw/usr/bin/cron ($(du -h raw/usr/bin/cron | cut -f1))"
# 2. Sync frontend files to raw package
cp app.js raw/usr/share/casaos/www/modules/cron/app.js
cp index.html raw/usr/share/casaos/www/modules/cron/index.html
cp styles.css raw/usr/share/casaos/www/modules/cron/styles.css
echo "Frontend files synced to raw package"
# 3. Create .raw sysext package
mksquashfs raw/ cron.raw -noappend -comp gzip -quiet
echo "Done. Package: cron.raw ($(du -h cron.raw | cut -f1))"