version: 2 jobs: build: working_directory: ~/dd-trace-java docker: - image: circleci/openjdk:8-jdk steps: - checkout - restore_cache: # Reset the cache approx every release key: dd-trace-java-{{ checksum "dd-trace-java.gradle" }} - run: name: Run Tests command: GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xmx1G -Xms512M" ./gradlew clean check --parallel --stacktrace --no-daemon --max-workers=3 - run: name: Verify Version Scan command: ./gradlew verifyVersionScan --parallel --stacktrace --no-daemon - save_cache: paths: - ~/.gradle key: dd-trace-java-{{ checksum "dd-trace-java.gradle" }} - store_test_results: path: dd-java-agent/build/test-results - store_test_results: path: dd-java-agent-ittests/build/test-results - store_test_results: path: dd-trace/build/test-results - store_artifacts: path: dd-java-agent/build/reports - store_artifacts: path: dd-java-agent-ittests/build/reports - store_artifacts: path: dd-trace/build/reports - store_artifacts: path: dd-java-agent/build/libs - store_artifacts: path: dd-trace/build/libs - run: name: Decode Signing Key command: echo $PGP_KEY_FILE | base64 --decode > /home/circleci/dd-trace-java/.circleci/secring.gpg - deploy: name: Publish master to Artifactory command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then ./gradlew -Psigning.keyId=${PGP_KEY_ID} \ -Psigning.password=${PGP_KEY_PASS} \ -Psigning.secretKeyRingFile=/home/circleci/dd-trace-java/.circleci/secring.gpg \ -PbintrayUser=${BINTRAY_USER} \ -PbintrayApiKey=${BINTRAY_API_KEY} \ -PbuildInfo.build.number=${CIRCLE_BUILD_NUM} \ artifactoryPublish --max-workers=1 --stacktrace --no-daemon fi