Skip to content

Commit

Permalink
fix launch.sh exit code
Browse files Browse the repository at this point in the history
Signed-off-by: Daisuke Sato <[email protected]>
  • Loading branch information
daisukes committed Feb 21, 2024
1 parent c8a72b1 commit bf4a0e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
14 changes: 5 additions & 9 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ cd $scriptdir
dcfile=

dcfile=docker-compose
if [ $simulation -eq 0 ]; then dcfile="${dcfile}-production"; fi
if [ $CABOT_HEADLESS -eq 1 ]; then dcfile="${dcfile}-headless"; fi
if [[ $simulation -eq 0 ]]; then dcfile="${dcfile}-production"; fi
if [[ $CABOT_HEADLESS -eq 1 ]]; then dcfile="${dcfile}-headless"; fi
dcfile="${dcfile}.yaml"

if [ ! -e $dcfile ]; then
Expand All @@ -243,12 +243,8 @@ fi

dccom="docker compose -f $dcfile"


if [[ $CABOT_HEADLESS -eq 1 ]]; then
./server-launch.sh -c -p $CABOT_SITE
else
gnome-terminal -- bash -c "./server-launch.sh -c -p $CABOT_SITE -v; exit"
fi
## launch server
./server-launch.sh -c -p $CABOT_SITE

if [ $verbose -eq 0 ]; then
com2="bash -c \"setsid $dccom --ansi never up --no-build --abort-on-container-exit\" > $host_ros_log_dir/docker-compose.log &"
Expand Down Expand Up @@ -282,7 +278,7 @@ if [[ $run_test -eq 1 ]]; then
else
docker compose exec navigation /home/developer/ros2_ws/script/run_test.sh -w $module $test_func
fi
exit $?
ctrl_c $?
fi

while [ 1 -eq 1 ];
Expand Down
2 changes: 1 addition & 1 deletion script/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ trap ctrl_c INT QUIT TERM

function ctrl_c() {
echo "Test terminated"
exit 0
exit $1
}

function err {
Expand Down
8 changes: 5 additions & 3 deletions server-launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ mkdir -p $temp_dir
if [[ $clean_server -eq 2 ]]; then
blue "Clean servers"
for service in "map_server" "map_data" "mongodb"; do
if [[ ! -z $(docker ps -f "name=$server" -q -a) ]]; then
docker ps -f "name=$server" -q -a | xargs docker stop
docker ps -f "name=$server" -q -a | xargs docker container rm
if [[ ! -z $(docker ps -f "name=$service" -q -a) ]]; then
blue "stopping $service"
docker ps -f "name=$service"
docker ps -f "name=$service" -q -a | xargs docker stop
docker ps -f "name=$service" -q -a | xargs docker container rm
fi
done
exit 0
Expand Down

0 comments on commit bf4a0e3

Please sign in to comment.