diff --git a/.circleci/Dockerfile b/.circleci/Dockerfile new file mode 100644 index 0000000000..336e393b6e --- /dev/null +++ b/.circleci/Dockerfile @@ -0,0 +1,22 @@ +# Dockerfile for the container CircleCI uses to build and test helios +FROM ubuntu:bionic + +RUN apt-get -qq update && apt-get -qq install \ + # Required tools for primary containers that aren't already in bionic + # https://circleci.com/docs/2.0/custom-images/#required-tools-for-primary-containers + git ssh \ + # tools we need + wget maven jq + +# Download and validate checksum of openjdk-11 +# Checksum from https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz.sha256 +RUN wget --quiet https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz && \ + echo '3784cfc4670f0d4c5482604c7c513beb1a92b005f569df9bf100e8bef6610f2e openjdk-11_linux-x64_bin.tar.gz' > openjdk-11-sha256sum.txt && \ + sha256sum -c openjdk-11-sha256sum.txt + +# Install openjdk-11 +RUN tar -xzf openjdk-11_linux-x64_bin.tar.gz && \ + mkdir -p /usr/lib/jvm && \ + mv jdk-11 /usr/lib/jvm/openjdk-11 && \ + update-alternatives --install /usr/bin/java java /usr/lib/jvm/openjdk-11/bin/java 20000 && \ + update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/openjdk-11/bin/javac 20000 diff --git a/.circleci/config.yml b/.circleci/config.yml index 147b3b5b77..a540685b1a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,6 @@ jobs: apt-get -y -qq install jq update-alternatives --set java /usr/lib/jvm/$JAVA_VERSION/bin/java; sudo update-alternatives --set javac /usr/lib/jvm/$JAVA_VERSION/bin/javac; echo -e "export JAVA_HOME=/usr/lib/jvm/$JAVA_VERSION" >> $BASH_ENV if [[ $(python --version 2>&1) = *"2.7.10"* ]] || pyenv versions --bare | grep -x -q '2.7.10'; then pyenv global 2.7.10;else pyenv install --skip-existing 2.7.10 && pyenv global 2.7.10 && pyenv rehash && pip install virtualenv && pip install nose && pip install pep8 && pyenv rehash;fi - # Configuring Docker to accept remote connections - run: ./circle.sh pre_machine @@ -54,7 +53,7 @@ jobs: - store_test_results: path: /tmp/circleci-test-results - + # Save artifacts - store_artifacts: path: /tmp/circleci-artifacts @@ -64,3 +63,56 @@ jobs: path: /var/log/upstart/docker.log - store_artifacts: path: /tmp/circleci-test-results + + build_java11: + docker: + - image: dxia/bionic-openjdk11:test + + working_directory: ~/spotify/helios + parallelism: 6 + shell: /bin/bash --login + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + MAVEN_OPTS: -Xmx128m + + steps: + # Machine Setup + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # The following `checkout` command checks out your code to your working directory. In 1.0 this is done implicitly. In 2.0 you can choose where in the course of a job your code should be checked out. + - checkout + + - setup_remote_docker + + # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS + + - run: ./circle.sh pre_machine + + - run: ./circle.sh dependencies + + - run: ./circle.sh test + + - run: if [ "$CIRCLE_NODE_INDEX" == "0" ]; then ./circle.sh post_test; fi + + - run: ./circle.sh collect_test_reports + + - store_test_results: + path: /tmp/circleci-test-results + + # Save artifacts + - store_artifacts: + path: /tmp/circleci-artifacts + - store_artifacts: + path: artifacts + - store_artifacts: + path: /var/log/upstart/docker.log + - store_artifacts: + path: /tmp/circleci-test-results + +workflows: + version: 2 + build_and_test: + jobs: + - build + - build_java11