Files
OpenMQTTGateway/scripts/prepare_deploy.sh
Florian 454a062b3b [OTA] Enable 2 clicks OTA update / one simple MQTT command (#1485)
* [OTA] Add automatic OTA updates

This feature will enable to update the gateway with one button or a simple MQTT command.

* [CI] Enable automatic OTA for nightly development builds

And integrate the latest_version file creation into the CI

Enable to specify a particular version
and switch between dev and production builds
2023-02-27 12:54:30 -06:00

27 lines
697 B
Bash
Executable File

#!/bin/bash
set -e
echo "renaming bin files with the environment name"
rename -v 's:/:-:g' .pio/build/*/*.bin
mkdir toDeploy
rename 's/.pio-build-//' .*.bin
(
cd .pio/libdeps
echo "replace space by _ in folder names"
find . -type d -name "* *" | while read FNAME; do mv "$FNAME" "${FNAME// /_}"; done
echo "zipping libraries per board"
for i in */
do
zip -r "${i%/}-libraries.zip" "$i"
done
ls -lA
mv *.zip ../../toDeploy
)
# remove binaries for *-all*, *-test* env and only zip containing *-test*
rm -f *-all*.bin *-test*.bin *-test*.zip
echo "zipping code and licence"
zip -r OpenMQTTGateway_sources.zip main LICENSE.txt
mv *.zip toDeploy
mv *.bin toDeploy
ls -lA toDeploy