From 0f1e46139b529a641fa9882239ee2c8471d99225 Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Tue, 14 Dec 2021 17:13:07 +0900 Subject: [PATCH 1/3] [jsk_fetch_startup] Suppress catkin build log --- jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh b/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh index 6a285a1cec..d750def514 100755 --- a/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh +++ b/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh @@ -16,7 +16,7 @@ cd $HOME/ros/melodic catkin clean aques_talk collada_urdf_jsk_patch -y catkin init catkin config -DCMAKE_BUILD_TYPE=Release -catkin build -v +catkin build CATKIN_BUILD_RESULT=$? # Send mail MAIL_BODY="" From 37f36b2b85f6a0933a4b6c63cd3ee8c73eb2338f Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Tue, 14 Dec 2021 17:30:01 +0900 Subject: [PATCH 2/3] display std_output and send mail only when update workspece fails --- .../scripts/update_workspace.sh | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh b/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh index d750def514..4b0fa147ca 100755 --- a/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh +++ b/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh @@ -27,15 +27,17 @@ if [ $CATKIN_BUILD_RESULT -ne 0 ]; then MAIL_BODY=$MAIL_BODY"Please catkin build workspace manually." fi set +x -} > $LOGFILE 2>&1 -rostopic pub -1 /email jsk_robot_startup/Email "header: - seq: 0 - stamp: {secs: 0, nsecs: 0} - frame_id: '' -subject: 'Daily workspace update fails' -body: '$MAIL_BODY' -sender_address: '$(hostname)@jsk.imi.i.u-tokyo.ac.jp' -receiver_address: 'fetch@jsk.imi.i.u-tokyo.ac.jp' -smtp_server: '' -smtp_port: '' -attached_files: ['$LOGFILE']" +} 2>&1 | tee $LOGFILE +if [ -n "$MAIL_BODY" ]; then + rostopic pub -1 /email jsk_robot_startup/Email "header: + seq: 0 + stamp: {secs: 0, nsecs: 0} + frame_id: '' + subject: 'Daily workspace update fails' + body: '$MAIL_BODY' + sender_address: '$(hostname)@jsk.imi.i.u-tokyo.ac.jp' + receiver_address: 'fetch@jsk.imi.i.u-tokyo.ac.jp' + smtp_server: '' + smtp_port: '' + attached_files: ['$LOGFILE']" +fi From 6b9e2d4f025b4bc7acc97f0e04e02d1a4c3b9e4c Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Tue, 14 Dec 2021 18:44:56 +0900 Subject: [PATCH 3/3] Not using tee and fix incorrect indent --- .../scripts/update_workspace.sh | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh b/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh index 4b0fa147ca..f27e401366 100755 --- a/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh +++ b/jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh @@ -27,17 +27,17 @@ if [ $CATKIN_BUILD_RESULT -ne 0 ]; then MAIL_BODY=$MAIL_BODY"Please catkin build workspace manually." fi set +x -} 2>&1 | tee $LOGFILE +} > $LOGFILE 2>&1 if [ -n "$MAIL_BODY" ]; then - rostopic pub -1 /email jsk_robot_startup/Email "header: - seq: 0 - stamp: {secs: 0, nsecs: 0} - frame_id: '' - subject: 'Daily workspace update fails' - body: '$MAIL_BODY' - sender_address: '$(hostname)@jsk.imi.i.u-tokyo.ac.jp' - receiver_address: 'fetch@jsk.imi.i.u-tokyo.ac.jp' - smtp_server: '' - smtp_port: '' - attached_files: ['$LOGFILE']" + rostopic pub -1 /email jsk_robot_startup/Email "header: + seq: 0 + stamp: {secs: 0, nsecs: 0} + frame_id: '' +subject: 'Daily workspace update fails' +body: '$MAIL_BODY' +sender_address: '$(hostname)@jsk.imi.i.u-tokyo.ac.jp' +receiver_address: 'fetch@jsk.imi.i.u-tokyo.ac.jp' +smtp_server: '' +smtp_port: '' +attached_files: ['$LOGFILE']" fi