-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy
executable file
·52 lines (48 loc) · 1.38 KB
/
deploy
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
#!/bin/bash
DEVBOX=192.168.29.10
echo $1
dir=$(pwd)
if [[ -f ./index.html.gz ]]
then
gunzip *.gz
fi
version=$(git describe --abbrev=4 --dirty --always --tags)"-["$(git rev-parse --abbrev-ref HEAD)"]"
rm dist/spa/* -rf
sed -e "s/Version:.*$/Version:${version}/" <src/layouts/RgbwwLayout.vue >src/layouts/RgbwwLayout.vue.1 && \
mv src/layouts/RgbwwLayout.vue src/layouts/RgbwwLayout.vue.2 && \
cp src/layouts/RgbwwLayout.vue.1 src/layouts/RgbwwLayout.vue
echo "deploying prod"
npx quasar build
cd $dir
#pwd
# ./minifyFontnames.sh
#pwd
./gzipSPA.sh
echo $version >dist/spa/VERSION
echo "VUE_APP_BUILD_NUMBER=$version" >.env
echo "deploying "
cat dist/spa/VERSION
echo "parameter: $1"
if [ "$1" == "local" ]
then
echo "deploying locally"
if [ ! -d ~/devel/esp_rgbww_firmware/webapp ]
then
mkdir ~/devel/esp_rgbww_firmware/webapp }
fi
cp -auv dist/spa/* ~/devel/esp_rgbww_firmware/webapp/
cd ~/devel/esp_rgbww_firmware
make -j8
cd $dir
else
echo "deplyoing to $DEVBOX"
ssh $DEVBOX "if [ ! -d ~/devel/esp_rgbww_firmware/webapp ]; then mkdir ~/devel/esp_rgbww_firmware/webapp;fi"
ssh $DEVBOX "rm -rf ~/devel/esp_rgbww_firmware/webapp/*"
rsync -a dist/spa/ $DEVBOX:~/devel/esp_rgbww_firmware/webapp
if [ "$1" = "OTA" ]
then
ssh $DEVBOX "cd devel/esp_rgbww_firmware/;make -j8;./deployOta PART_LAYOUT=v1"
else
ssh $DEVBOX "cd devel/esp_rgbww_firmware/;make -j8 flash PART_LAYOUT=v1"
fi
fi