11version : 2
2+
3+ defaults : &defaults
4+ working_directory : ~/dd-trace-java
5+ resource_class : large
6+ docker :
7+ - image : circleci/openjdk:8
8+
9+ test_job : &test_job
10+ steps :
11+ - attach_workspace :
12+ at : .
13+
14+ - run :
15+ name : Run Tests
16+ command : GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xmx2G -Xms512M" ./gradlew -g=gradle-home test --parallel --stacktrace --no-daemon --max-workers=3
17+
18+ - run :
19+ name : Save Artifacts to (project-root)/build
20+ when : always
21+ command : .circleci/save_artifacts.sh
22+
23+ - store_test_results :
24+ path : build/test-results
25+
26+ - store_artifacts :
27+ path : build
28+
29+ - persist_to_workspace :
30+ root : .
31+ paths : .
32+
233jobs :
334 build :
4- working_directory : ~/dd-trace-java
35+ << : *defaults
536 docker :
637 - image : circleci/openjdk:8-jdk
7- resource_class : xlarge
838
939 steps :
1040 - checkout
1141
1242 - restore_cache :
1343 # Reset the cache approx every release
14- key : dd-trace-java-{{ checksum "dd-trace-java.gradle" }}
44+ keys :
45+ - dd-trace-java-{{ checksum "dd-trace-java.gradle" }}-{{ .Branch }}-{{ .Revision }}-verified
46+ - dd-trace-java-{{ checksum "dd-trace-java.gradle" }}-{{ .Branch }}-{{ .Revision }}
47+ - dd-trace-java-{{ checksum "dd-trace-java.gradle" }}-{{ .Branch }}
48+ - dd-trace-java-{{ checksum "dd-trace-java.gradle" }}
49+ - dd-trace-java
1550
1651 - run :
1752 name : Build Project
18- command : GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xmx2G -Xms512M" ./gradlew clean compileJava compileTestJava compileGroovy compileTestGroovy shadowJar --stacktrace --no-daemon
53+ command : GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xmx2G -Xms512M" ./gradlew -g=gradle-home clean check -x test --stacktrace --no-daemon
54+
55+ - save_cache :
56+ key : dd-trace-java-{{ checksum "dd-trace-java.gradle" }}-{{ .Branch }}-{{ .Revision }}
57+ paths : gradle-home
58+ background : true
59+
60+ - persist_to_workspace :
61+ root : .
62+ paths : .
63+
64+ test_7 :
65+ << : *defaults
66+ docker :
67+ - image : openjdk:7-jdk
68+
69+ steps :
70+ - attach_workspace :
71+ at : .
72+
73+ - run :
74+ name : Fix EC parameters error # (ref https://github.com/travis-ci/travis-ci/issues/8503)
75+ command : |
76+ wget "https://downloads.bouncycastle.org/java/bcprov-ext-jdk15on-158.jar" -O "${JAVA_HOME}"/jre/lib/ext/bcprov-ext-jdk15on-158.jar && \
77+ perl -pi.bak -e 's/^(security\.provider\.)([0-9]+)/$1.($2+1)/ge' /etc/java-7-openjdk/security/java.security && \
78+ echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" | tee -a /etc/java-7-openjdk/security/java.security
1979
2080 - run :
2181 name : Run Tests
22- command : GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xmx2G -Xms512M" ./gradlew check --parallel --stacktrace --no-daemon --max-workers=3
82+ command : GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xmx2G -Xms512M" ./gradlew -g=gradle-home test --parallel --stacktrace --no-daemon --max-workers=3
2383
2484 - run :
25- name : Verify Version Scan
26- command : ./gradlew verifyVersionScan --parallel --stacktrace --no-daemon
85+ name : Save Artifacts to (project-root)/build
86+ when : always
87+ command : .circleci/save_artifacts.sh
2788
28- - save_cache :
29- paths :
30- - ~/.gradle
31- key : dd-trace-java-{{ checksum "dd-trace-java.gradle" }}
89+ - store_test_results :
90+ path : build/test-results
91+
92+ - store_artifacts :
93+ path : build
94+
95+ test_8 :
96+ << : *defaults
97+ << : *test_job
98+ docker :
99+ - image : circleci/openjdk:8-jdk
100+
101+ # test_9:
102+ # <<: *defaults
103+ # <<: *test_job
104+ # docker:
105+ # - image: circleci/openjdk:9-jdk
106+
107+ scan_and_save :
108+ << : *defaults
109+ steps :
110+ - attach_workspace :
111+ at : .
112+
113+ - run :
114+ name : Verify Version Scan
115+ command : ./gradlew -g=gradle-home verifyVersionScan --parallel --stacktrace --no-daemon
32116
33117 - run :
34118 name : Save Artifacts to (project-root)/build
@@ -41,6 +125,16 @@ jobs:
41125 - store_artifacts :
42126 path : build
43127
128+ - save_cache :
129+ key : dd-trace-java-{{ checksum "dd-trace-java.gradle" }}-{{ .Branch }}-{{ .Revision }}-verified
130+ paths : gradle-home
131+
132+ deploy :
133+ << : *defaults
134+ steps :
135+ - attach_workspace :
136+ at : .
137+
44138 - run :
45139 name : Decode Signing Key
46140 command : echo $PGP_KEY_FILE | base64 --decode > /home/circleci/dd-trace-java/.circleci/secring.gpg
@@ -49,11 +143,41 @@ jobs:
49143 name : Publish master to Artifactory
50144 command : |
51145 if [ "${CIRCLE_BRANCH}" == "master" ]; then
52- ./gradlew -Psigning.keyId=${PGP_KEY_ID} \
146+ ./gradlew -g=gradle-home - Psigning.keyId=${PGP_KEY_ID} \
53147 -Psigning.password=${PGP_KEY_PASS} \
54148 -Psigning.secretKeyRingFile=/home/circleci/dd-trace-java/.circleci/secring.gpg \
55149 -PbintrayUser=${BINTRAY_USER} \
56150 -PbintrayApiKey=${BINTRAY_API_KEY} \
57151 -PbuildInfo.build.number=${CIRCLE_BUILD_NUM} \
58152 artifactoryPublish --max-workers=1 --stacktrace --no-daemon
59153 fi
154+
155+ workflows :
156+ version : 2
157+ build_test_deploy :
158+ jobs :
159+ - build
160+
161+ - test_7 :
162+ requires :
163+ - build
164+ - test_8 :
165+ requires :
166+ - build
167+ # - test_9:
168+ # requires:
169+ # - build
170+
171+ - scan_and_save :
172+ requires :
173+ - build
174+ - test_7
175+ - test_8
176+ # - test_9
177+
178+ - deploy :
179+ requires :
180+ - scan_and_save
181+ filters :
182+ branches :
183+ only : master
0 commit comments