diff --git a/.travis.yml b/.travis.yml index 5500b8e62..c725dfd86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,3 @@ -language: java -jdk: - - openjdk11 - services: - docker @@ -20,6 +16,7 @@ before_install: - curl -L https://github.com/docker/compose/releases/download/1.26.2/docker-compose-`uname -s`-`uname -m` > /tmp/docker-compose - chmod +x /tmp/docker-compose - sudo mv /tmp/docker-compose /usr/local/bin + - ./ci/install-jdk.sh - APP_VERSION=$([ -n "${TRAVIS_TAG}" ] && echo "${TRAVIS_TAG#*v}" || echo "${TRAVIS_BRANCH##*/}") - DOCKER_IMAGE_VERSION=$([ -n "${TRAVIS_TAG}" ] && echo "${TRAVIS_TAG}" || echo "${TRAVIS_BRANCH##*/}") @@ -32,7 +29,7 @@ install: script: - chmod +x gradlew && ./gradlew inttest --tests com.faforever.api.clan.ClanControllerTest -# - chmod +x gradlew && ./gradlew ${GRADLE_CLI_OPTS} build -Pversion=${APP_VERSION} + - chmod +x gradlew && ./gradlew ${GRADLE_CLI_OPTS} build -Pversion=${APP_VERSION} after_success: - ./gradlew ${GRADLE_CLI_OPTS} jacocoTestReport coveralls diff --git a/ci/installjdk.sh b/ci/installjdk.sh new file mode 100644 index 000000000..688c9aa38 --- /dev/null +++ b/ci/installjdk.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +if test -d "~/$JDK"; then + echo "already installed" + exit 0 +fi + +mkdir -p ~/bin +url="https://raw.githubusercontent.com/sormuras/bach/master/install-jdk.sh" +wget "$url" -P ~/bin/ || { + echo "${ANSI_RED}Could not acquire install-jdk.sh. Stopping build.${ANSI_RESET}" >/dev/stderr + exit 2 +} +chmod +x ~/bin/install-jdk.sh +export JAVA_HOME="~/$JDK" +~/bin/install-jdk.sh --url "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.7_10.tar.gz" --target "$JAVA_HOME" --workspace "$TRAVIS_HOME/.cache/install-jdk" --cacerts \ No newline at end of file