33# Check https://circleci.com/docs/2.0/language-java/ for more details
44#
55version : 2.1
6+
7+ aliases :
8+ attach_workspace : &attach_workspace
9+ attach_workspace :
10+ at : .
11+
12+ environment : &environment
13+ environment :
14+ SPRING_BOOT_VERSION : 2.2.0.RELEASE
15+ SPRING_VERSION : 5.2.0.RELEASE
16+ SPRING_DATA_VERSION : 2.2.0.RELEASE
17+ MICROMETER_VERSION : 1.3.2
18+
19+ persist_to_workspace : &persist_to_workspace
20+ persist_to_workspace :
21+ root : .
22+ paths :
23+ - .
24+
25+ redis_dep : &redis_dep
26+ run :
27+ name : Install Dependencies
28+ command : |
29+ sudo add-apt-repository ppa:chris-lea/redis-server
30+ sudo apt-get update
31+ sudo apt-get -y install redis-server
32+ redis-cli --version
33+
34+ redis_cluster_setup : &redis_cluster_setup
35+ run :
36+ name : Setup Redis Cluster
37+ background : true
38+ command : |
39+ mkdir 9000 9001 9002 9003 9004 9005
40+ printf "port 9000 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9000/redis.conf
41+ printf "port 9001 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9001/redis.conf
42+ printf "port 9002 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9002/redis.conf
43+ printf "port 9003 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9003/redis.conf
44+ printf "port 9004 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9004/redis.conf
45+ printf "port 9005 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9005/redis.conf
46+ cd 9000 && redis-server ./redis.conf &
47+ cd 9001 && redis-server ./redis.conf &
48+ cd 9002 && redis-server ./redis.conf &
49+ cd 9003 && redis-server ./redis.conf &
50+ cd 9004 && redis-server ./redis.conf &
51+ cd 9005 && redis-server ./redis.conf &
52+ sleep 30
53+ redis-cli --cluster create 127.0.0.1:9000 127.0.0.1:9001 127.0.0.1:9002 127.0.0.1:9003 127.0.0.1:9004 127.0.0.1:9005 --cluster-replicas 1 --cluster-yes
54+
55+ default : &default
56+ executor : rqueue-executor
57+ << : *environment
58+
59+ copy_logs : ©_logs
60+ run :
61+ name : Copy Log Files
62+ when : always
63+ command : |
64+ mkdir log || true
65+ test -f rqueue-core/log/monitor.log && cp rqueue-core/log/monitor.log log/core-monitor.log
66+ test -f rqueue-core/log/test.log && cp rqueue-core/log/test.log log/core-test.log
67+ test -f rqueue-spring-boot-starter/log/monitor.log && cp rqueue-spring-boot-starter/log/monitor.log log/boot-monitor.log
68+ test -f rqueue-spring-boot-starter/log/test.log && cp rqueue-spring-boot-starter/log/test.log log/boot-test.log
69+ test -f rqueue-spring/log/monitor.log && cp rqueue-spring/log/monitor.log log/spring-monitor.log
70+ test -f rqueue-spring/log/test.log && cp rqueue-spring/log/test.log log/spring-test.log
71+
72+ copy_test_results : ©_test_results
73+ run :
74+ name : Copy Test Result Files
75+ when : always
76+ command : |
77+ mkdir test-results || true
78+ test -d rqueue-spring-boot-starter/build/reports/junit/xml && cp -r rqueue-spring-boot-starter/build/reports/junit/xml test-results
79+ test -d rqueue-spring/build/reports/junit/xml && cp -r rqueue-spring/build/reports/junit/xml test-results
80+ test -d rqueue-core/build/reports/junit/xml && cp -r rqueue-core/build/reports/junit/xml test-results
81+
82+ store_logs : &store_logs
83+ store_artifacts :
84+ path : log/
85+ store_test_results : &store_test_results
86+ store_test_results :
87+ path : test-results
88+
89+
690executors :
791 rqueue-executor :
892 machine :
@@ -22,13 +106,7 @@ executors:
22106
23107jobs :
24108 build :
25- executor : rqueue-executor
26- environment :
27- SPRING_BOOT_VERSION : 2.1.0.RELEASE
28- SPRING_VERSION : 5.1.2.RELEASE
29- SPRING_DATA_VERSION : 2.1.2.RELEASE
30- MICROMETER_VERSION : 1.1.0
31-
109+ << : *default
32110 steps :
33111 - checkout
34112 - restore_cache :
@@ -44,126 +122,67 @@ jobs:
44122 key : v1-dependencies-{{ checksum "build.gradle" }}
45123 - run : ./gradlew compileJava
46124 - run : ./gradlew compileTestJava
47- - persist_to_workspace :
48- root : .
49- paths :
50- - .
125+ - *persist_to_workspace
126+
51127 unit_test :
52- executor : rqueue-executor
53- environment :
54- SPRING_BOOT_VERSION : 2.1.0.RELEASE
55- SPRING_VERSION : 5.1.2.RELEASE
56- SPRING_DATA_VERSION : 2.1.2.RELEASE
57- MICROMETER_VERSION : 1.1.0
128+ << : *default
58129 steps :
59- - attach_workspace :
60- at : .
130+ - *attach_workspace
61131 - run : ./gradlew codeCoverageReport -DincludeTags=unit
62- - persist_to_workspace :
63- root : .
64- paths :
65- - .
132+ - *persist_to_workspace
133+ - *copy_logs
134+ - *copy_test_results
135+ - *store_logs
136+ - *store_test_results
137+
138+
66139 producer_only_test :
67- executor : rqueue-executor
68- environment :
69- SPRING_BOOT_VERSION : 2.1.0.RELEASE
70- SPRING_VERSION : 5.1.2.RELEASE
71- SPRING_DATA_VERSION : 2.1.2.RELEASE
72- MICROMETER_VERSION : 1.1.0
140+ << : *default
73141 steps :
74- - attach_workspace :
75- at : .
76- - run :
77- name : Install Dependencies
78- command : |
79- sudo add-apt-repository ppa:chris-lea/redis-server
80- sudo apt-get update
81- sudo apt-get -y install redis-server
82- redis-cli --version
142+ - *attach_workspace
143+ - *redis_dep
83144 - run : ./gradlew codeCoverageReport -DincludeTags=producerOnly
84- - persist_to_workspace :
85- root : .
86- paths :
87- - .
145+ - *persist_to_workspace
146+ - *copy_logs
147+ - *copy_test_results
148+ - *store_logs
149+ - *store_test_results
150+
88151
89152 integration_test :
90- executor : rqueue-executor
91- environment :
92- SPRING_BOOT_VERSION : 2.1.0.RELEASE
93- SPRING_VERSION : 5.1.2.RELEASE
94- SPRING_DATA_VERSION : 2.1.2.RELEASE
95- MICROMETER_VERSION : 1.1.0
153+ << : *default
96154 steps :
97- - attach_workspace :
98- at : .
99- - run :
100- name : Install Dependencies
101- command : |
102- sudo add-apt-repository ppa:chris-lea/redis-server
103- sudo apt-get update
104- sudo apt-get -y install redis-server
105- redis-cli --version
155+ - *attach_workspace
156+ - *redis_dep
106157 - run : ./gradlew codeCoverageReport -DincludeTags=integration -DexcludeTags=redisCluster,producerOnly
107- - persist_to_workspace :
108- root : .
109- paths :
110- - .
158+ - *persist_to_workspace
159+ - *copy_logs
160+ - *copy_test_results
161+ - *store_logs
162+ - *store_test_results
111163
112164 redis_custer_test :
113- executor : rqueue-executor
114- environment :
115- SPRING_BOOT_VERSION : 2.1.0.RELEASE
116- SPRING_VERSION : 5.1.2.RELEASE
117- SPRING_DATA_VERSION : 2.1.2.RELEASE
118- MICROMETER_VERSION : 1.1.0
165+ << : *default
119166 steps :
120- # Reuse the workspace from the build job
121- - attach_workspace :
122- at : .
123- - run :
124- name : Install Dependencies
125- command : |
126- sudo add-apt-repository ppa:chris-lea/redis-server
127- sudo apt-get update
128- sudo apt-get -y install redis-server
129- redis-cli --version
130- - run :
131- name : Setup Redis Cluster
132- background : true
133- command : |
134- mkdir 9000 9001 9002 9003 9004 9005
135- printf "port 9000 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9000/redis.conf
136- printf "port 9001 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9001/redis.conf
137- printf "port 9002 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9002/redis.conf
138- printf "port 9003 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9003/redis.conf
139- printf "port 9004 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9004/redis.conf
140- printf "port 9005 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9005/redis.conf
141- cd 9000 && redis-server ./redis.conf &
142- cd 9001 && redis-server ./redis.conf &
143- cd 9002 && redis-server ./redis.conf &
144- cd 9003 && redis-server ./redis.conf &
145- cd 9004 && redis-server ./redis.conf &
146- cd 9005 && redis-server ./redis.conf &
147- sleep 30
148- redis-cli --cluster create 127.0.0.1:9000 127.0.0.1:9001 127.0.0.1:9002 127.0.0.1:9003 127.0.0.1:9004 127.0.0.1:9005 --cluster-replicas 1 --cluster-yes
167+ - *attach_workspace
168+ - *redis_dep
169+ - *redis_cluster_setup
149170 - run : ./gradlew codeCoverageReport -DincludeTags=redisCluster
150- - persist_to_workspace :
151- root : .
152- paths :
153- - .
171+ - *persist_to_workspace
172+ - *copy_logs
173+ - *copy_test_results
174+ - *store_logs
175+ - *store_test_results
176+
154177 report_code_coverage :
155- executor : rqueue-executor
156- environment :
157- SPRING_BOOT_VERSION : 2.1.0.RELEASE
158- SPRING_VERSION : 5.1.2.RELEASE
159- SPRING_DATA_VERSION : 2.1.2.RELEASE
160- MICROMETER_VERSION : 1.1.0
178+ << : *default
161179 steps :
162- - attach_workspace :
163- at : .
164- - run : ls -r build/reports/jacoco/test
165- - run : pwd
180+ - *attach_workspace
166181 - run : ./gradlew coveralls
182+ - *copy_logs
183+ - *copy_test_results
184+ - *store_logs
185+ - *store_test_results
167186
168187workflows :
169188 main :
0 commit comments