Skip to content

Commit

Permalink
scripts should fail harder when they fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Mar 8, 2024
1 parent a44b110 commit da1ad5b
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/hw-ci/build_for_hw_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ HW_TARGET=$2
# .github/workflows/hw-ci/build_for_hw_ci.sh config/boards/f407-discovery f407-discovery
# .github/workflows/hw-ci/build_for_hw_ci.sh config/boards/proteus proteus_f4

set -e
set -euo pipefail

echo "HW CI build [$HW_FOLDER][$HW_TARGET]"

cd firmware
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hw-ci/run_hw_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

HW_SUITE=$1

set -e
set -euo pipefail

cd java_tools
./gradlew :autotest:shadowJar
Expand Down
2 changes: 1 addition & 1 deletion firmware/config/boards/common_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PROJECT_BOARD=$1
PROJECT_CPU=$2

# fail on error
set -e
set -euo pipefail

SCRIPT_NAME="common_make.sh"
echo "Entering $SCRIPT_NAME with board $1 and CPU $2"
Expand Down
2 changes: 1 addition & 1 deletion firmware/gen_config_board.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# or ./gen_config_board.sh hellen/hellen128 hellen128
# which is short for ./gen_config_board.sh hellen/hellen128 hellen128 rusefi_hellen128.ini

set -e
set -euo pipefail

echo "This script reads rusefi_config.txt and produces firmware persistent configuration headers"
echo "the storage section of rusefiXXX.ini is updated as well"
Expand Down
2 changes: 1 addition & 1 deletion firmware/hw_layer/mass_storage/create_ini_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# hw_layer/mass_storage/create_ini_image.sh tunerstudio/generated/rusefi.ini hw_layer/mass_storage/ramdisk_image.h 112 test https://rusefi.com/s/test

# fail on error
set -e
set -euo pipefail

if [ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ] || [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then
echo No image on $(uname -s)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# hw_layer/mass_storage/create_ini_image_compressed.sh tunerstudio/generated/rusefi.ini hw_layer/mass_storage/ramdisk_image.h 1024 test https://rusefi.com/s/test

# fail on error
set -e
set -euo pipefail

if [ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ] || [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then
echo No image on $(uname -s)
Expand Down
4 changes: 2 additions & 2 deletions misc/jenkins/build_working_folder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# file build_working_folder.sh
#

set -euo pipefail

FULL_BUNDLE_FILE="${BUNDLE_FULL_NAME}.zip"

echo "${BUNDLE_FULL_NAME}: Packaging temp/$FULL_BUNDLE_FILE file"
Expand Down Expand Up @@ -62,8 +64,6 @@ RUSEFI_CONSOLE_SETTINGS=""
cp -r misc/install/STM32_Programmer_CLI $CONSOLE_FOLDER

cp firmware/deliver/fome.bin $FOLDER
# just for now - DFU work in progress
cp firmware/deliver/fome.hex $FOLDER

# bootloader
[ -e firmware/deliver/fome_bl.bin ] && { cp firmware/deliver/fome_bl.bin $FOLDER ; }
Expand Down
2 changes: 1 addition & 1 deletion misc/jenkins/compile_other_versions/compile.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# fail on error!
set -e
set -euo pipefail

# for example 'config/boards/proteus'
BOARD_DIR="$1"
Expand Down
2 changes: 1 addition & 1 deletion simulator/compile.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

rm -f build/fome_simulator.exe
make -j8 -r $@
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/run_sharded_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This script runs every test in its own process (own invocation of fome_test executable)
# This allows us to test for accidental cross-test leakage that fixes/breaks something

set -e
set -euo pipefail

export GTEST_TOTAL_SHARDS=600
for IDX in {0..599}
Expand Down

0 comments on commit da1ad5b

Please sign in to comment.