Skip to content

Commit 97623a0

Browse files
committed
infra: avoid usage of 'set -e' in travis.yml (advice from support) to avoid timeouting of job
1 parent 4addc09 commit 97623a0

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

.ci/travis.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@ set -e
44

55
case $1 in
66

7+
init-m2-settings)
8+
MVN_SETTINGS=${TRAVIS_HOME}/.m2/settings.xml
9+
export JAVA_HOME="/usr/lib/jvm/"$(ls /usr/lib/jvm/ | head -n 1)"/"
10+
echo "JAVA_HOME="$JAVA_HOME
11+
export PATH=$JAVA_HOME/bin:$PATH
12+
if [[ -f ${MVN_SETTINGS} ]]; then
13+
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
14+
sed -i'' -e "/<mirrors>/,/<\/mirrors>/ d" $MVN_SETTINGS
15+
else
16+
xmlstarlet ed --inplace -d "//mirrors" $MVN_SETTINGS
17+
fi
18+
fi
19+
;;
20+
21+
init-m2-repo)
22+
if [[ $USE_MAVEN_REPO == 'true' && ! -d "~/.m2" ]]; then
23+
echo "Maven local repo cache is not found, initializing it ..."
24+
cd sevntu-checks
25+
mvn -e --no-transfer-progress install -Pno-validations
26+
cd ../
27+
fi
28+
;;
29+
730
pr-description)
831
.ci/xtr_pr-description.sh
932
;;

.travis.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,9 @@ script:
8989
echo "Installed JVMs: "
9090
ls /usr/lib/jvm/
9191
- |
92-
set -e
9392
if [[ $RUN_JOB == 1 ]]; then
94-
MVN_SETTINGS=${TRAVIS_HOME}/.m2/settings.xml
95-
export JAVA_HOME="/usr/lib/jvm/"$(ls /usr/lib/jvm/ | head -n 1)"/"
96-
echo "JAVA_HOME="$JAVA_HOME
97-
export PATH=$JAVA_HOME/bin:$PATH
98-
if [[ -f ${MVN_SETTINGS} ]]; then
99-
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
100-
sed -i'' -e "/<mirrors>/,/<\/mirrors>/ d" $MVN_SETTINGS
101-
else
102-
xmlstarlet ed --inplace -d "//mirrors" $MVN_SETTINGS
103-
fi
104-
fi
105-
if [[ $USE_MAVEN_REPO == 'true' && ! -d "~/.m2" ]]; then
106-
echo "Maven local repo cache is not found, initializing it ..."
107-
cd sevntu-checks
108-
mvn -e --no-transfer-progress install -Pno-validations
109-
cd ../
110-
fi
93+
./.ci/travis.sh init-m2-settings
94+
./.ci/travis.sh init-m2-repo
11195
echo "eval of CMD is starting";
11296
echo "CMD=$CMD";
11397
eval $CMD;

0 commit comments

Comments
 (0)