aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.travis
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x.travis/track_status.sh25
1 files changed, 21 insertions, 4 deletions
diff --git a/.travis/track_status.sh b/.travis/track_status.sh
index 3702676..0e3d2d8 100755
--- a/.travis/track_status.sh
+++ b/.travis/track_status.sh
@@ -2,18 +2,35 @@
set -o errexit -o nounset -o pipefail
-main() {
+track_status() {
local log_path
log_path="$( mktemp )"
+ echo "Log file path: $log_path"
+
+ local rm_log_path
+ rm_log_path="$( printf -- 'rm -f -- %q' "$log_path" )"
- nohup python3 -m bin.track_status egor.tensin > "$log_path" 2>&1 &
+ trap "$rm_log_path" RETURN
+
+ echo 'Running track_status.py...'
+ python3 -m bin.track_status egor.tensin --log "$log_path" &
local pid="$!"
+ echo "Its PID is $pid"
+
+ local timeout=15
+ echo "Sleeping for $timeout seconds..."
+ sleep "$timeout"
- sleep 15
+ echo 'Terminating track_status.py...'
kill -SIGINT "$pid"
+ echo 'Waiting for track_status.py to terminate...'
wait "$pid"
cat "$log_path"
}
-main
+main() {
+ track_status
+}
+
+main "$@"