forked from verybadsoldier/esp_rgbww_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployOta.old
executable file
·82 lines (78 loc) · 1.49 KB
/
deployOta.old
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
BASE_URL=
#BASE_URL=http://192.168.29.10:8080
FW_VERSION=$(git describe --abbrev=4 --dirty --always --tags)
WEBAPP_VERSION=$(cat ./spiffs/VERSION)
WEBROOT=~/nginx/html
cat <<EOF > version.json
{
"rom":
{
"fw_version":"$FW_VERSION",
"url":"$BASE_URL/Esp8266/v1/rom0.bin"
},
"spiffs":
{
"webapp_version":"$WEBAPP_VERSION",
"url":"$BASE_URL/Esp8266/v1/spiff_rom.bin"
},
"firmware":
[
{
"partitioning":"v1",
"soc":"Esp8266",
"files":
{
"rom":
{
"fw_version":"$FW_VERSION",
"url":"$BASE_URL/Esp8266/v1/rom0.bin"
},
"spiffs":
{
"webapp_version":"$WEBAPP_VERSION",
"url":"$BASE_URL/Esp8266/v1/spiff_rom.bin"
}
}
},
{
"partitioning":"v2",
"soc":"Esp8266",
"files":
{
"rom":
{
"fw_version":"$FW_VERSION",
"url":"$BASE_URL/Esp8266/v2/rom0.bin"
},
"spiffs":
{
"webapp_version":"$WEBAPP_VERSION",
"url":"$BASE_URL/Esp8266/v2/spiff_rom.bin"
}
}
},
{
"partitioning":"v2",
"soc":"Esp32",
"files":
{
"rom":
{
"fw_version":"$FW_VERSION",
"url":"$BASE_URL/Esp32/v2/rom0.bin"
},
"spiffs":
{
"webapp_version":"$WEBAPP_VERSION",
"url":"$BASE_URL/Esp32/v2/spiff_rom.bin"
}
}
}
]
}
EOF
echo "deploying OTA files to webserver"
cat version.json
cp version.json $WEBROOT
cp out/Esp8266/debug/firmware/rom0.bin $WEBROOT/Esp8266/v1
cp out/Esp8266/debug/firmware/spiff_rom.bin $WEBROOT/Esp8266/v1