From 5d44c7938a4dcf68cf2edbb31cc590db3d0166f6 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira da Silva Date: Mon, 12 Aug 2019 14:06:38 -0300 Subject: [PATCH] Travis improvements - Cache dependencies - Use JBoss repositories to download Maven dependencies --- .travis.yml | 6 +++++- maven-settings.xml | 52 +++++++++++++++++++++++++++++++++++++++++++++ travis-run-tests.sh | 8 +++---- 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 maven-settings.xml diff --git a/.travis.yml b/.travis.yml index bb1f72e27c..d2344f5f1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,11 @@ language: java cache: - cache: false + directories: + - $HOME/.m2 + +before_cache: + - rm -rf $HOME/.m2/repository/org/keycloak env: global: diff --git a/maven-settings.xml b/maven-settings.xml new file mode 100644 index 0000000000..9a7e3cd3bc --- /dev/null +++ b/maven-settings.xml @@ -0,0 +1,52 @@ + + + + org.jenkins-ci.tools + + + + + jboss-public-repository + + + jboss-public-repository-group + JBoss Public Maven Repository Group + http://repository.jboss.org/nexus/content/groups/public/ + default + + true + never + + + true + never + + + + + + jboss-public-repository-group + JBoss Public Maven Repository Group + http://repository.jboss.org/nexus/content/groups/public/ + default + + true + never + + + true + never + + + + + + + + jboss-public-repository + + + diff --git a/travis-run-tests.sh b/travis-run-tests.sh index f2b1292460..b853dace79 100755 --- a/travis-run-tests.sh +++ b/travis-run-tests.sh @@ -2,7 +2,7 @@ function run-server-tests() { cd testsuite/integration-arquillian - mvn install -B -nsu -Pauth-server-wildfly -DskipTests + mvn -s $TRAVIS_BUILD_DIR/maven-settings.xml install -B -nsu -Pauth-server-wildfly -DskipTests cd tests/base mvn test -B -nsu -Pauth-server-wildfly "-Dtest=$1" $2 2>&1 | java -cp ../../../utils/target/classes org.keycloak.testsuite.LogTrimmer @@ -61,7 +61,7 @@ echo Compiling Keycloak ( while : ; do echo "Compiling, please wait..." ; sleep 50 ; done ) & COMPILING_PID=$! TMPFILE=`mktemp` -if ! mvn install -B -nsu -Pdistribution -DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn &> "$TMPFILE"; then +if ! mvn -s $TRAVIS_BUILD_DIR/maven-settings.xml install -B -nsu -Pdistribution -DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn &> "$TMPFILE"; then cat "$TMPFILE" exit 1 fi @@ -100,7 +100,7 @@ fi if [ $1 == "crossdc-server" ]; then cd testsuite/integration-arquillian - mvn install -B -nsu -Pauth-servers-crossdc-jboss,auth-server-wildfly,cache-server-infinispan -DskipTests + mvn -s $TRAVIS_BUILD_DIR/maven-settings.xml install -B -nsu -Pauth-servers-crossdc-jboss,auth-server-wildfly,cache-server-infinispan -DskipTests cd tests/base mvn clean test -B -nsu -Pcache-server-infinispan,auth-servers-crossdc-jboss,auth-server-wildfly -Dtest=org.keycloak.testsuite.crossdc.**.* 2>&1 | @@ -110,7 +110,7 @@ fi if [ $1 == "crossdc-adapter" ]; then cd testsuite/integration-arquillian - mvn install -B -nsu -Pauth-servers-crossdc-jboss,auth-server-wildfly,cache-server-infinispan,app-server-wildfly -DskipTests + mvn -s $TRAVIS_BUILD_DIR/maven-settings.xml install -B -nsu -Pauth-servers-crossdc-jboss,auth-server-wildfly,cache-server-infinispan,app-server-wildfly -DskipTests cd tests/base mvn clean test -B -nsu -Pcache-server-infinispan,auth-servers-crossdc-jboss,auth-server-wildfly,app-server-wildfly -Dtest=org.keycloak.testsuite.adapter.**.crossdc.**.* 2>&1 |