Skip to content

Commit 19fdba4

Browse files
committed
Add travis time counter/printer
Allows us to get output even though we are often quiet for about 10 mins.
1 parent 5092d4a commit 19fdba4

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed

.travis.yml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,12 @@ node:
77
script:
88
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then echo Travis SECURE available -- Deploy; else echo Travis SECURE NOT available -- Verify; fi"
99

10-
#TODO: Rework this to use the build matrix (or find a way to get a few extra messages in the log)
11-
#- mvn deploy -Pall,juno --quiet --settings settings.xml
12-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pwin32,juno --quiet --settings settings.xml; else mvn verify -Pwin32,juno --quiet --settings settings.xml; fi"
13-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pwin64,juno --quiet --settings settings.xml; else mvn verify -Pwin64,juno --quiet --settings settings.xml; fi"
14-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pmac32,juno --quiet --settings settings.xml; else mvn verify -Pmac32,juno --quiet --settings settings.xml; fi"
15-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pmac64,juno --quiet --settings settings.xml; else mvn verify -Pmac64,juno --quiet --settings settings.xml; fi"
16-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Plinux32,juno --quiet --settings settings.xml; else mvn verify -Plinux32,juno --quiet --settings settings.xml; fi"
17-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Plinux64,juno --quiet --settings settings.xml; else mvn verify -Plinux64,juno --quiet --settings settings.xml; fi"
10+
#Test only - TODO remove
11+
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then ./travis_exec_and_print_time.sh "sleep 5"; else ./travis_exec_and_print_time.sh "sleep 5"; fi"
1812

19-
#- mvn deploy -Pall,kepler --quiet --settings settings.xml
20-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pwin32,juno --quiet --settings settings.xml; else mvn verify -Pwin32,kepler --quiet --settings settings.xml; fi"
21-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pwin64,kepler --quiet --settings settings.xml; else mvn verify -Pwin64,kepler --quiet --settings settings.xml; fi"
22-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pmac32,kepler --quiet --settings settings.xml; else mvn verify -Pmac32,kepler --quiet --settings settings.xml; fi"
23-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pmac64,kepler --quiet --settings settings.xml; else mvn verify -Pmac64,kepler --quiet --settings settings.xml; fi"
24-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Plinux32,kepler --quiet --settings settings.xml; else mvn verify -Plinux32,kepler --quiet --settings settings.xml; fi"
25-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Plinux64,kepler --quiet --settings settings.xml; else mvn verify -Plinux64,kepler --quiet --settings settings.xml; fi"
26-
27-
28-
#- mvn deploy -Pall,luna --quiet --settings settings.xml
29-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pwin32,luna --quiet --settings settings.xml; else mvn verify -Pwin32,luna --quiet --settings settings.xml; fi"
30-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pwin64,luna --quiet --settings settings.xml; else mvn verify -Pwin64,luna --quiet --settings settings.xml; fi"
31-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pmac32,luna --quiet --settings settings.xml; else mvn verify -Pmac32,luna --quiet --settings settings.xml; fi"
32-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Pmac64,luna --quiet --settings settings.xml; else mvn verify -Pmac64,luna --quiet --settings settings.xml; fi"
33-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Plinux32,luna --quiet --settings settings.xml; else mvn verify -Plinux32,luna --quiet --settings settings.xml; fi"
34-
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then mvn deploy -Plinux64,luna --quiet --settings settings.xml; else mvn verify -Plinux64,luna --quiet --settings settings.xml; fi"
13+
#mvn deploy (or verify) -Pall,juno,kepler,luna --quiet --settings settings.xml
14+
15+
- sh -c "if $TRAVIS_SECURE_ENV_VARS; then ./travis_exec_and_print_time.sh "mvn deploy -Pall,juno,kepler,luna --quiet --settings settings.xml"; else ./travis_exec_and_print_time.sh "mvn verify -Pall,juno,kepler,luna --quiet --settings settings.xml"; fi"
3516

3617

3718

travis_exec_and_print_time.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Exec and print time periodically"
4+
#CMD="sleep 5"
5+
#echo "CMD=$CMD"
6+
#$CMD &
7+
8+
#Take first argument as the command to execute
9+
echo "CMD=$1"
10+
$1 &
11+
12+
PID=$!
13+
14+
echo "Testing for PID=$PID"
15+
16+
#Sleep for X seconds and then test if the PID is still active
17+
# inefficient but not too bad for this use case
18+
# also not safe from race conditions in general but fine here
19+
while sleep 60
20+
kill -0 $PID >/dev/null 2>&1
21+
do
22+
echo "Still running at $SECONDS seconds"
23+
done
24+
25+
echo "Ran for $SECONDS seconds"
26+

0 commit comments

Comments
 (0)