forked from vaslabs/pi-web-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.sh
executable file
·36 lines (31 loc) · 850 Bytes
/
package.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
#!/bin/bash
build_dir=$(mktemp -d)
echo "Working directory ${build_dir}"
function copy_system_files() {
cp -r service/system/lib $build_dir/
cp -r service/system/etc $build_dir/
cp -r service/system/usr $build_dir/
}
function copy_backend_main() {
cp -r service/web/pi-web-agent $build_dir/piwebagent2
}
function copy_ui_assets() {
mkdir -p $build_dir/usr/share/piwebagent2/
cp -r ui/pi-web-agent-app/dist/pi-web-agent-app $build_dir/usr/share/piwebagent2/assets
}
function zip_app() {
[ -d target ] && rm -r target
mkdir -p target/piwebagent2
mv $build_dir/* target/piwebagent2
cd target
zip -r piwebagent2.zip piwebagent2
cd ..
}
echo "Copying system files"
copy_system_files
echo "Copying piwebagent2 binary"
copy_backend_main
echo "Copying ui assets"
copy_ui_assets
echo "Archiving..."
zip_app