-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.bak
More file actions
executable file
·55 lines (53 loc) · 1.65 KB
/
deploy.bak
File metadata and controls
executable file
·55 lines (53 loc) · 1.65 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
51
52
53
54
#!/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.1 && cp src/layouts/RgbwwLayout.vue.1 src/layouts/RgbwwLayout.vue
if [ "$1" = "debug" ]
then
echo "deploying debug"
npx quasar build -d
else
echo "deploying prod"
npx quasar build
fi
cd $dir
pwd
# npm run minify-fonts
# ./minifyFontnames.sh
pwd
./gzipSPA.sh
if [ "$1" = "debug" ]
then
version=$version"-debug"
fi
echo $version >dist/spa/VERSION
echo "VUE_APP_BUILD_NUMBER=$version" >.env
echo "deploying "
cat dist/spa/VERSION
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" = "debug" -o -f dist/spa/assets/index.js.map.gz ]
then
echo "parameter: $1"
ls -l dist/spa/assets/index.js.map.gz
echo "creating debug stype partition layout"
ssh $DEVBOX "cd devel/esp_rgbww_firmware;cp hwconfig.debug hwconfig.hw"
else
echo "creating production style partition layout"
ssh $DEVBOX "cd devel/esp_rgbww_firmware;cp hwconfig.prod hwconfig.hw"
fi
#ssh $DEVBOX "cd devel/esp_rgbww_firmware/;make clean;make -j8 flash PART=spiffs0"
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