-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·50 lines (40 loc) · 1.05 KB
/
setup.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.05 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
#!/usr/bin/env bash
set -xe
SELFDIR="$(realpath "$(dirname "$0")")"
cd "$SELFDIR"
STORAGE_DIR="${SELFDIR}/storage"
RELEASE=""
while [[ $# -gt 0 ]]; do
case $1 in
--release)
RELEASE=1
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
STORAGE_DIR="$1"
shift # past argument
;;
esac
done
RELEASE_FLAG=""
[ "$RELEASE" ] && RELEASE_FLAG="--release"
TARGET_DIR="debug"
[ "$RELEASE" ] && TARGET_DIR="release"
pushd pixie-uefi
cargo build $RELEASE_FLAG
[ "$RELEASE" ] && upx --best "target/x86_64-unknown-uefi/${TARGET_DIR}/pixie-uefi.efi"
popd
pushd pixie-web
trunk build $RELEASE_FLAG
popd
pushd pixie-server
cargo build $RELEASE_FLAG
popd
mkdir -p "${STORAGE_DIR}/tftpboot" "${STORAGE_DIR}/images" "${STORAGE_DIR}/chunks" "${STORAGE_DIR}/admin"
cp "pixie-uefi/target/x86_64-unknown-uefi/${TARGET_DIR}/pixie-uefi.efi" "${STORAGE_DIR}/tftpboot/"
cp -r pixie-web/dist/* "${STORAGE_DIR}/admin/"
[ -f "${STORAGE_DIR}/config.yaml" ] || cp pixie-server/example.config.yaml "${STORAGE_DIR}/config.yaml"