mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
make so it can run from outside scripts directory
This commit is contained in:
@@ -11,16 +11,13 @@ is_git() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stat_bytes() {
|
stat_bytes() {
|
||||||
echo "size is:"
|
filesize=`du -k "$1" | cut -f1;`
|
||||||
case "$(uname -s)" in
|
echo 'size:' $filesize 'bytes'
|
||||||
Darwin) stat -f %z "$1";;
|
|
||||||
*) stat -c %s "$1";;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Available environments
|
# Available environments
|
||||||
list_envs() {
|
list_envs() {
|
||||||
grep env: ../platformio.ini | sed 's/\[env:\(.*\)\]/\1/g'
|
grep env: platformio.ini | sed 's/\[env:\(.*\)\]/\1/g'
|
||||||
}
|
}
|
||||||
|
|
||||||
print_available() {
|
print_available() {
|
||||||
@@ -59,7 +56,7 @@ set_default_environments() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_webui() {
|
build_webui() {
|
||||||
cd ../tools/webfilesbuilder
|
cd ./tools/webfilesbuilder
|
||||||
|
|
||||||
# Build system uses gulpscript.js to build web interface
|
# Build system uses gulpscript.js to build web interface
|
||||||
if [ ! -e node_modules/gulp/bin/gulp.js ]; then
|
if [ ! -e node_modules/gulp/bin/gulp.js ]; then
|
||||||
@@ -73,12 +70,6 @@ build_webui() {
|
|||||||
echo "Building web interface..."
|
echo "Building web interface..."
|
||||||
node node_modules/gulp/bin/gulp.js || exit
|
node node_modules/gulp/bin/gulp.js || exit
|
||||||
|
|
||||||
# TODO: do something if webui files are different
|
|
||||||
# for now, just print in travis log
|
|
||||||
if ${TRAVIS:-false}; then
|
|
||||||
git --no-pager diff --stat
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,10 +79,9 @@ build_environments() {
|
|||||||
mkdir -p $destination/EMS-ESP-$version
|
mkdir -p $destination/EMS-ESP-$version
|
||||||
|
|
||||||
for environment in $environments; do
|
for environment in $environments; do
|
||||||
echo -n "* EMS-ESP-$version-$environment.bin --- "
|
echo "* EMS-ESP-$version-$environment.bin"
|
||||||
platformio run --silent --environment $environment || exit 1
|
platformio run --silent --environment $environment || exit 1
|
||||||
stat_bytes .pio/build/$environment/firmware.bin
|
stat_bytes .pio/build/$environment/firmware.bin
|
||||||
[[ "${TRAVIS_BUILD_STAGE_NAME}" = "Test" ]] || \
|
|
||||||
mv .pio/build/$environment/firmware.bin $destination/EMS-ESP-$version/EMS-ESP-$version-$environment.bin
|
mv .pio/build/$environment/firmware.bin $destination/EMS-ESP-$version/EMS-ESP-$version-$environment.bin
|
||||||
done
|
done
|
||||||
echo "--------------------------------------------------------------"
|
echo "--------------------------------------------------------------"
|
||||||
@@ -101,7 +91,7 @@ build_environments() {
|
|||||||
####### MAIN
|
####### MAIN
|
||||||
|
|
||||||
destination=firmware
|
destination=firmware
|
||||||
version_file=../src/version.h
|
version_file=./src/version.h
|
||||||
version=$(grep -E '^#define APP_VERSION' $version_file | awk '{print $3}' | sed 's/"//g')
|
version=$(grep -E '^#define APP_VERSION' $version_file | awk '{print $3}' | sed 's/"//g')
|
||||||
|
|
||||||
if ${TRAVIS:-false}; then
|
if ${TRAVIS:-false}; then
|
||||||
@@ -115,6 +105,8 @@ else
|
|||||||
git_tag=
|
git_tag=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo $git_tag
|
||||||
|
|
||||||
if [[ -n $git_tag ]]; then
|
if [[ -n $git_tag ]]; then
|
||||||
new_version=${version/-*}
|
new_version=${version/-*}
|
||||||
sed -i -e "s@$version@$new_version@" $version_file
|
sed -i -e "s@$version@$new_version@" $version_file
|
||||||
@@ -183,7 +175,7 @@ fi
|
|||||||
# for debugging
|
# for debugging
|
||||||
echo "* git_revision = $git_revision"
|
echo "* git_revision = $git_revision"
|
||||||
echo "* git_tag = $git_tag"
|
echo "* git_tag = $git_tag"
|
||||||
echo "* TRAVIS_EVENT_TYPE = $TRAVIS_EVENT_TYPE"
|
echo "* TRAVIS_COMMIT = $TRAVIS_COMMIT"
|
||||||
echo "* TRAVIS_TAG = $TRAVIS_TAG"
|
echo "* TRAVIS_TAG = $TRAVIS_TAG"
|
||||||
echo "* TRAVIS_BRANCH = $TRAVIS_BRANCH"
|
echo "* TRAVIS_BRANCH = $TRAVIS_BRANCH"
|
||||||
echo "* TRAVIS_BUILD_STAGE_NAME = $TRAVIS_BUILD_STAGE_NAME"
|
echo "* TRAVIS_BUILD_STAGE_NAME = $TRAVIS_BUILD_STAGE_NAME"
|
||||||
|
|||||||
Reference in New Issue
Block a user