Files
ESPEasy/before_deploy
T
2018-11-06 15:56:36 +01:00

55 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
VERSION=$(git describe)
#Naming convention:
# ESP_Easy_[github version]_[plugin set]_[chip type]_[flash memory].bin
for ENV in \
normal_ESP8266_1024 \
normal_ESP8266_4096 \
normal_ESP8285_1024 \
normal_IR_ESP8266_4096 \
normal_core_241_ESP8266_1024 \
normal_core_241_ESP8266_4096 \
test_ESP8266_1024\
test_ESP8266_4096\
test_ESP8266_4096_VCC\
test_ESP8285_1024\
dev_ESP8266_1024\
dev_ESP8266_4096\
dev_ESP8285_1024\
hard_SONOFF_POW\
hard_SONOFF_POW_R2_4M\
minimal_ESP8266_1024_OTA\
minimal_ESP8285_1024_OTA\
esp32dev\
esp32test_1M8_partition;\
do
echo
echo "### Deploying environment $ENV for version $VERSION"
BIN=.pioenvs/${ENV}/ESP_Easy_${VERSION}_${ENV}.bin
cp .pioenvs/${ENV}/firmware.bin $BIN
python2 crc2.py $BIN
mv $BIN "dist/bin/ESP_Easy_${VERSION}_${ENV}.bin"
done
#create a source structure that is the same as the original ESPEasy project (and works with the howto on the wiki)
#rm -rf dist/Source 2>/dev/null
rm -rf dist/Docs 2>/dev/null
mkdir -p dist/source
#mkdir -p dist/docs
cp -r lib dist/source/
cp -r src dist/source/
#cp -r docs/build/ dist/docs/
cp platformio.ini dist/source/
cd dist
echo
echo "### Creating zip archive"
zip ../ESPEasy_$VERSION.zip -r .