| # |
| # 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 |
| unit_java8: |
| docker: |
| - image: cimg/openjdk:8.0 |
| environment: |
| skipIntegrationTest: true |
| steps: |
| - checkout |
| - run: ./gradlew --info check -x integrationTest --stacktrace |
| |
| - store_artifacts: |
| path: build/reports |
| destination: test-reports |
| |
| - store_test_results: |
| path: build/test-results/ |
| |
| integration_cassandra_40_java8: |
| docker: |
| - image: circleci/openjdk:8-jdk-stretch |
| environment: |
| INTEGRATION_MAX_PARALLEL_FORKS: 1 |
| INTEGRATION_MAX_HEAP_SIZE: "4G" |
| resource_class: large |
| steps: |
| - checkout |
| # Cassandra 4.0 jar seems to be missing some dependencies, so we use 4.1 here (this is what we currently do) |
| - run: BRANCHES="cassandra-4.0 cassandra-4.1" scripts/build-dtest-jars.sh |
| - run: ./gradlew --no-daemon -PdtestVersion=4.1.4 -Dcassandra.sidecar.versions_to_test="4.0" --info checkstyleIntegrationTest spotbugsIntegrationTest integrationTest --stacktrace |
| |
| - store_artifacts: |
| path: build/reports |
| destination: test-reports |
| |
| - store_test_results: |
| path: build/test-results/ |
| |
| integration_cassandra_41_java8: |
| docker: |
| - image: circleci/openjdk:8-jdk-stretch |
| environment: |
| INTEGRATION_MAX_PARALLEL_FORKS: 1 |
| INTEGRATION_MAX_HEAP_SIZE: "4G" |
| resource_class: large |
| steps: |
| - checkout |
| - run: BRANCHES="cassandra-4.1" scripts/build-dtest-jars.sh |
| - run: ./gradlew --no-daemon -PdtestVersion=4.1.4 -Dcassandra.sidecar.versions_to_test="4.1" --info checkstyleIntegrationTest spotbugsIntegrationTest integrationTest --stacktrace |
| |
| - store_artifacts: |
| path: build/reports |
| destination: test-reports |
| |
| - store_test_results: |
| path: build/test-results/ |
| |
| # Runs java 11 tests on a docker image |
| unit_java11: |
| docker: |
| - image: cimg/openjdk:11.0 |
| environment: |
| skipIntegrationTest: true |
| steps: |
| - checkout |
| - run: ./gradlew --info check -x integrationTest --stacktrace |
| |
| - store_artifacts: |
| path: build/reports |
| destination: test-reports |
| |
| - store_test_results: |
| path: build/test-results/ |
| |
| integration_cassandra_40_java11: |
| docker: |
| - image: circleci/openjdk:11-jdk-stretch |
| environment: |
| INTEGRATION_MAX_PARALLEL_FORKS: 1 |
| INTEGRATION_MAX_HEAP_SIZE: "4G" |
| resource_class: large |
| steps: |
| - checkout |
| # Cassandra 4.0 jar seems to be missing some dependencies, so we use 4.1 here (this is what we currently do) |
| - run: BRANCHES="cassandra-4.0 cassandra-4.1" CASSANDRA_USE_JDK11=true scripts/build-dtest-jars.sh |
| - run: ./gradlew --no-daemon -PdtestVersion=4.1.4 -Dcassandra.sidecar.versions_to_test="4.0" --info checkstyleIntegrationTest spotbugsIntegrationTest integrationTest --stacktrace |
| |
| - store_artifacts: |
| path: build/reports |
| destination: test-reports |
| |
| - store_test_results: |
| path: build/test-results/ |
| |
| integration_cassandra_50_java11: |
| docker: |
| - image: circleci/openjdk:11-jdk-stretch |
| environment: |
| INTEGRATION_MAX_PARALLEL_FORKS: 1 |
| INTEGRATION_MAX_HEAP_SIZE: "4G" |
| resource_class: large |
| steps: |
| - checkout |
| - run: BRANCHES="cassandra-5.0" scripts/build-dtest-jars.sh |
| - run: ./gradlew --no-daemon -PdtestVersion=5.0-alpha2 -Dcassandra.sidecar.versions_to_test="5.0" --info checkstyleIntegrationTest spotbugsIntegrationTest integrationTest --stacktrace |
| |
| - store_artifacts: |
| path: build/reports |
| destination: test-reports |
| |
| - store_test_results: |
| path: build/test-results/ |
| |
| integration_cassandra_trunk_java11: |
| docker: |
| - image: circleci/openjdk:11-jdk-stretch |
| environment: |
| INTEGRATION_MAX_PARALLEL_FORKS: 1 |
| INTEGRATION_MAX_HEAP_SIZE: "4G" |
| resource_class: large |
| steps: |
| - checkout |
| - run: BRANCHES="trunk" scripts/build-dtest-jars.sh |
| - run: ./gradlew --no-daemon -PdtestVersion=5.1 -Dcassandra.sidecar.versions_to_test="5.1" --info checkstyleIntegrationTest spotbugsIntegrationTest integrationTest --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: |
| - unit_java8 |
| - integration_cassandra_40_java8: |
| requires: |
| - unit_java8 |
| - integration_cassandra_41_java8: |
| requires: |
| - unit_java8 |
| - unit_java11 |
| - integration_cassandra_40_java11: |
| requires: |
| - unit_java11 |
| - integration_cassandra_50_java11: |
| requires: |
| - unit_java11 |
| - integration_cassandra_trunk_java11: |
| requires: |
| - unit_java11 |
| - docs_build: |
| requires: |
| - unit_java8 |
| - integration_cassandra_40_java8 |
| - integration_cassandra_41_java8 |
| - unit_java11 |
| - integration_cassandra_40_java11 |
| - integration_cassandra_50_java11 |
| - integration_cassandra_trunk_java11 |
| - docker_build: |
| requires: |
| - unit_java8 |
| - integration_cassandra_40_java8 |
| - integration_cassandra_41_java8 |
| - unit_java11 |
| - integration_cassandra_40_java11 |
| - integration_cassandra_50_java11 |
| - integration_cassandra_trunk_java11 |
| - rpm_build_install: |
| requires: |
| - unit_java8 |
| - integration_cassandra_40_java8 |
| - integration_cassandra_41_java8 |
| - unit_java11 |
| - integration_cassandra_40_java11 |
| - integration_cassandra_50_java11 |
| - integration_cassandra_trunk_java11 |
| - deb_build_install: |
| requires: |
| - unit_java8 |
| - integration_cassandra_40_java8 |
| - integration_cassandra_41_java8 |
| - unit_java11 |
| - integration_cassandra_40_java11 |
| - integration_cassandra_50_java11 |
| - integration_cassandra_trunk_java11 |
| - docker_build: |
| requires: |
| - unit_java8 |
| - integration_cassandra_40_java8 |
| - integration_cassandra_41_java8 |
| - unit_java11 |
| - integration_cassandra_40_java11 |
| - integration_cassandra_50_java11 |
| - integration_cassandra_trunk_java11 |