forked from jsk-ros-pkg/jsk_robot
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from tkmtnt7000/PR/update-workspace-script
- Loading branch information
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 26 additions & 4 deletions
30
jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
. $HOME/ros/melodic/devel/setup.bash | ||
# Filename should end with .txt to preview the contents in a web browser | ||
LOGFILE=$HOME/ros/melodic/update_workspace.txt | ||
|
||
{ | ||
set -x | ||
|
||
# Update workspace | ||
cd $HOME/ros/melodic/src | ||
ln -sf $(rospack find jsk_fetch_startup)/../jsk_fetch.rosinstall.$ROS_DISTRO $HOME/ros/melodic/src/.rosinstall | ||
wstool foreach --git 'git stash' | ||
wstool update --delete-changed-uris | ||
if [ $? -ne 0 ]; then | ||
LC_CTYPE=en_US.UTF-8 /bin/echo -e "Please update workspace manually" | /usr/bin/mail -s "Daily wstool update fails" -r $(hostname)@jsk.imi.i.u-tokyo.ac.jp [email protected] | ||
fi | ||
WSTOOL_UPDATE_RESULT=$? | ||
cd $HOME/ros/melodic | ||
catkin clean aques_talk collada_urdf_jsk_patch -y | ||
catkin init | ||
catkin config -DCMAKE_BUILD_TYPE=Release | ||
catkin build | ||
CATKIN_BUILD_RESULT=$? | ||
# Send mail | ||
MAIL_BODY="" | ||
if [ $WSTOOL_UPDATE_RESULT -ne 0 ]; then | ||
MAIL_BODY=$MAIL_BODY"Please wstool update workspace manually. " | ||
fi | ||
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: '[email protected]' | ||
smtp_server: '' | ||
smtp_port: '' | ||
attached_files: ['$LOGFILE']" |