forked from spotify/helios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.sh
executable file
·52 lines (36 loc) · 1.14 KB
/
circle.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash -ex
case "$1" in
pre_machine)
# have docker bind to localhost
docker_opts='DOCKER_OPTS="$DOCKER_OPTS -H tcp://127.0.0.1:2375"'
sudo sh -c "echo '$docker_opts' >> /etc/default/docker"
cat /etc/default/docker
;;
dependencies)
mvn clean install -T 2 -Dmaven.javadoc.skip=true -DskipTests=true -B -V
;;
pre_test)
# clean the artifacts dir from the previous build
rm -rf artifacts && mkdir artifacts
;;
test)
# expected parallelism: 2x. needs to be set in the project settings via CircleCI's UI.
case $CIRCLE_NODE_INDEX in
0)
# run all tests *except* helios-system-tests
sed -i'' 's/<module>helios-system-tests<\/module>//' pom.xml
mvn test -B
;;
1)
# run helios-system-tests
mvn test -B -pl helios-system-tests
;;
esac
;;
post_test)
# collect artifacts into the artifacts dir
find . -regex ".*/target/.*-[0-9]\.jar" | xargs -I {} mv {} artifacts
find . -regex ".*/target/.*-SNAPSHOT\.jar" | xargs -I {} mv {} artifacts
find . -regex ".*/target/.*\.deb" | xargs -I {} mv {} artifacts
;;
esac