| # |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| # Java Gradle CircleCI 2.0 configuration file |
| # |
| # Check https://circleci.com/docs/2.0/language-java/ for more details |
| # |
| version: 2.1 |
| |
| # need to reuse the same base environment for several tests |
| aliases: |
| base_job: &base_job |
| machine: |
| image: ubuntu-2004:202010-01 |
| working_directory: ~/repo |
| environment: |
| TERM: dumb |
| centos: ¢os |
| docker: |
| - image: centos:centos8 |
| working_directory: ~/repo |
| environment: |
| TERM: dumb |
| TZ: "America/Los_Angeles" |
| |
| # we might modify this in the future to accept a parameter for the java package to install |
| commands: |
| install_java: |
| description: "Installs Java using AdoptOpenJDK" |
| parameters: |
| version: |
| type: string |
| steps: |
| - run: wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add - |
| - run: sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ |
| - run: sudo apt-get update |
| - run: sudo apt-get install -y << parameters.version>> |
| |
| install_common: |
| description: "Installs common software and certificates" |
| steps: |
| - run: sudo apt-get update |
| - run: sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common |
| |
| jobs: |
| # Runs java 8 tests on a docker image |
| java8: |
| docker: |
| - image: circleci/openjdk:8-jdk-stretch |
| resource_class: large |
| steps: |
| - checkout |
| |
| - run: BRANCHES="cassandra-4.0 cassandra-4.1" scripts/build-dtest-jars.sh |
| - run: echo 'export DTEST_JAR=$(cd dtest-jars && find . -name 'dtest-4.1*.jar' -maxdepth 1)' >> "$BASH_ENV" |
| - run: ./gradlew --info check --stacktrace -Dcassandra.sidecar.versions_to_test="4.0,4.1" |
| |
| - store_artifacts: |
| path: build/reports |
| destination: test-reports |
| |
| - store_test_results: |
| path: build/test-results/ |
| |
| # Runs java 11 tests on a docker image |
| java11: |
| docker: |
| - image: circleci/openjdk:11-jdk-stretch |
| resource_class: large |
| steps: |
| - checkout |
| |
| - run: CASSANDRA_USE_JDK11=true scripts/build-dtest-jars.sh |
| - run: ./gradlew --info check --stacktrace |
| |
| - store_artifacts: |
| path: build/reports |
| destination: test-reports |
| |
| - store_test_results: |
| path: build/test-results/ |
| |
| # ensures we can build and install deb packages |
| deb_build_install: |
| docker: |
| - image: circleci/openjdk:11-jdk-stretch |
| steps: |
| - checkout |
| - run: ./gradlew -i clean buildDeb |
| - run: DEBIAN_FRONTEND=noninteractive sudo apt install -y ./build/distributions/cassandra-sidecar*.deb |
| - run: test -f /opt/cassandra-sidecar/bin/cassandra-sidecar |
| |
| # ensures we can build and install rpm packages |
| rpm_build_install: |
| <<: *centos |
| steps: |
| - run: sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* |
| - run: sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* |
| - run: dnf -qy distro-sync |
| - run: dnf -qy install java-11-openjdk git |
| - checkout |
| - run: JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-4.el8_5.x86_64 ${PWD}/gradlew -i buildRpm |
| - run: yum install -y ./build/distributions/cassandra-sidecar*.rpm |
| - run: test -f /opt/cassandra-sidecar/bin/cassandra-sidecar |
| |
| docker_build: |
| <<: *base_job |
| steps: |
| - checkout |
| - run: ./gradlew -i clean jibDockerBuild |
| |
| docs_build: |
| docker: |
| - image: circleci/openjdk:11-jdk-stretch |
| steps: |
| - checkout |
| - run: ./gradlew docs:asciidoctor |
| - run: test -f docs/build/user.html |
| - run: test -f docs/build/development.html |
| |
| workflows: |
| version: 2 |
| build-and-test: |
| jobs: |
| - java8 |
| - java11 |
| - docs_build: |
| requires: |
| - java8 |
| - java11 |
| - docker_build: |
| requires: |
| - java8 |
| - java11 |
| - rpm_build_install: |
| requires: |
| - java8 |
| - java11 |
| - deb_build_install: |
| requires: |
| - java8 |
| - java11 |
| - docker_build: |
| requires: |
| - java8 |
| - java11 |