buildFirmware.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. echo "Build process started"
  3. pushd components/wifi-manager/webapp/
  4. echo "Installing node.js dependencies"
  5. npm install
  6. echo "Building webapp"
  7. npm run-script build
  8. popd
  9. echo "Setting up build name and build number"
  10. if [ -z "${TARGET_BUILD_NAME}" ]
  11. then
  12. export TARGET_BUILD_NAME="I2S-4MFlash"
  13. echo "TARGET_BUILD_NAME is not set. Defaulting to ${TARGET_BUILD_NAME}"
  14. fi
  15. if [ -z "${BUILD_NUMBER}" ]
  16. then
  17. export BUILD_NUMBER="500"
  18. echo "BUILD_NUMBER is not set. Defaulting to ${BUILD_NUMBER}"
  19. fi
  20. if [ -z "$DEPTH" ]
  21. then
  22. export DEPTH="16"
  23. echo "DEPTH is not set. Defaulting to ${DEPTH}"
  24. fi
  25. if [ -z "$tag" ]
  26. then
  27. branch_name="$(git rev-parse --abbrev-ref HEAD)"
  28. branch_name="${branch_name//[^a-zA-Z0-9\-~!@_\.]/}"
  29. app_name="${TARGET_BUILD_NAME}.${DEPTH}.dev-$(git log --pretty=format:'%h' --max-count=1).${branch_name}"
  30. echo "${app_name}">version.txt
  31. echo "app_name is not set. Defaulting to ${app_name}"
  32. else
  33. echo "${tag}" >version.txt
  34. fi
  35. echo "Copying target sdkconfig"
  36. cp build-scripts/${TARGET_BUILD_NAME}-sdkconfig.defaults sdkconfig
  37. echo "Building project"
  38. idf.py build -DDEPTH=${DEPTH} -DBUILD_NUMBER=${BUILD_NUMBER}-${DEPTH}
  39. echo "Generating size report"
  40. idf.py size-components >build/size_components.txt
  41. idf.py size-components-squeezelite build/size_components_squeezelite.txt
  42. if [ -z "${artifact_file_name}" ]
  43. then
  44. echo "No artifact file name set. Will not generate zip file."
  45. else
  46. echo "Generating build artifact zip file"
  47. zip -r build_output.zip build
  48. zip build/${artifact_file_name} partitions*.csv build/*.bin build/bootloader/bootloader.bin build/partition_table/partition-table.bin build/flash_project_args build/size_*.txt
  49. fi