-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·66 lines (46 loc) · 1.7 KB
/
deploy.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
current_dir=$(pwd)
target_dir=$(mktemp -d)
mkdir -p $target_dir
echo "Target directory $target_dir"
# Copy all relevant files
cp -r node_modules $target_dir
for f in $(git ls-tree -r master --name-only); do
cp -r --parents $f $target_dir
done
# Clean up unwanted packrat files
rm -r $target_dir/pcago/packrat/lib*
# Distribution for linux
target_dir_linux=$(mktemp -d)
echo "Target directory for linux $target_dir_linux"
mkdir -p "$target_dir_linux/resources/app"
cp -r $target_dir/* "$target_dir_linux/resources/app"
cp -r electron-linux-x64/* $target_dir_linux
cp -r ffmpeg-linux-x64 $target_dir_linux/resources/app
cat << 'EOF' >> "$target_dir_linux/run.sh"
#!/bin/bash
./electron
EOF
chmod +x "$target_dir_linux/run.sh"
# Standard distribution (Electron + ffmpeg, but no precompiled libraries)
cd $target_dir_linux
rm $current_dir/pcago_electron_linux-x64-standard.zip
zip -r $current_dir/pcago_electron_linux-x64-standard.zip .
cd $current_dir
# Distribution for Ubuntu 16.04 (Electron + ffmpeg + precompiled libraries)
cd $target_dir_linux
rm -r $target_dir_linux/resources/app/pcago/packrat/lib*
cp -r $current_dir/packrat-Ubuntu-16.04-x64/lib $target_dir_linux/resources/app/pcago/packrat/
rm $current_dir/pcago_electron_linux-x64-ubuntu.zip
zip -r $current_dir/pcago_electron_linux-x64-ubuntu.zip .
cd $current_dir
# Minimal distribution for linux (only electron prepackaged)
cd $target_dir_linux
rm -r $target_dir_linux/resources/app/ffmpeg-linux-x64
rm -r $target_dir_linux/resources/app/pcago/packrat/lib*
rm $current_dir/pcago_electron_linux-x64-minimal.zip
zip -r $current_dir/pcago_electron_linux-x64-minimal.zip .
cd $current_dir
# Clear tmp
rm -r $target_dir
rm -r $target_dir_linux