-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrunMavenTests.sh
executable file
·39 lines (32 loc) · 1.32 KB
/
runMavenTests.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
#!/bin/bash
set -o errexit
LOCAL_MAVEN_REPO=${LOCAL_MAVEN_REPO-~/.m2}
VERIFIER_VERSION=${VERIFIER_VERSION:-1.0.0.BUILD-SNAPSHOT}
ROOT=`pwd`
cat <<EOF
Running tests with the following parameters
LOCAL_MAVEN_REPO=${LOCAL_MAVEN_REPO}
VERIFIER_VERSION=${VERIFIER_VERSION}
EOF
echo -e "\n\nClearing saved stubs"
rm -rf $LOCAL_MAVEN_REPO/repository/org/springframework/cloud/contract/testprojects/
echo -e "\n\nRunning tests for Maven (HTTP communication)\n\n"
echo -e "Building server (uses Spring Cloud Contract Verifier Maven Plugin)"
cd http-server
./mvnw clean install -Daccurest.version=${VERIFIER_VERSION}
cd $ROOT
echo -e "\n\nBuilding client (uses Spring Cloud Contract Stub Runner)"
cd http-client
./mvnw clean package -Daccurest.version=${VERIFIER_VERSION}
cd $ROOT
echo -e "\n\nClearing saved stubs"
rm -rf $LOCAL_MAVEN_REPO/repository/org/springframework/cloud/contract/testprojects/
echo -e "\n\nRunning tests for Maven (communication via messaging)\n\n"
echo -e "Building producer (uses Spring Cloud Contract Verifier Maven Plugin)"
cd contract-verifier-sample-stream-source
./mvnw clean install -Daccurest.version=${VERIFIER_VERSION}
cd $ROOT
echo -e "\n\nBuilding consumer (uses Spring Cloud Contract Stub Runner Messaging)"
cd contract-verifier-sample-stream-sink
./mvnw clean package -Daccurest.version=${VERIFIER_VERSION}
cd $ROOT