Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

  1. #!/bin/bash
  2. # Environments to build
  3. environments=$@
  4. if [ $# -eq 0 ]; then
  5. environments=`cat platformio.ini | grep env: | grep -v ota | sed 's/\[env://' | sed 's/\]/ /'`
  6. fi
  7. # Get current version
  8. version=`cat espurna/config/version.h | grep APP_VERSION | awk '{print $3}' | sed 's/"//g'`
  9. echo "--------------------------------------------------------------"
  10. echo "ESPURNA FIRMWARE BUILDER"
  11. echo "Building for version $version"
  12. # Create output folder
  13. mkdir -p firmware
  14. # Recreate web interface
  15. echo "--------------------------------------------------------------"
  16. echo "Building web interface..."
  17. node node_modules/gulp/bin/gulp.js || exit
  18. # Build all the required firmwares
  19. echo "--------------------------------------------------------------"
  20. echo "Building firmware images..."
  21. for environment in $environments; do
  22. echo "* espurna-$version-$environment.bin"
  23. platformio run -s -e $environment || exit
  24. mv .pioenvs/$environment/firmware.bin firmware/espurna-$version-$environment.bin
  25. done
  26. echo "--------------------------------------------------------------"