Repository navigation
Expand file tree
/
Copy pathbuild-components.sh
More file actions
executable file
·43 lines (39 loc) · 1.96 KB
/
Copy pathbuild-components.sh
File metadata and controls
executable file
·43 lines (39 loc) · 1.96 KB
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
#!/usr/bin/env bash
set -Eeuo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
WORKSPACE="$(cd "${ROOT}/.." && pwd)"
source "${ROOT}/scripts/lib/maven.sh"
source "${ROOT}/scripts/lib/java.sh"
openrec_setup_java
for path in rec-server sdk/java-client; do
[[ -f "${WORKSPACE}/${path}/pom.xml" ]] || {
echo "error: missing ${WORKSPACE}/${path}; run scripts/release/checkout-components.sh first" >&2
exit 1
}
done
command -v rsync >/dev/null 2>&1 || { echo "error: rsync is required" >&2; exit 1; }
BUILD_ROOT="${ROOT}/.runtime/ci-build"
mkdir -p "${BUILD_ROOT}/sdk" "${BUILD_ROOT}/openrec"
rsync -a --no-owner --no-group --delete --exclude .git --exclude target/ --exclude logs/ \
"${WORKSPACE}/rec-server/" "${BUILD_ROOT}/rec-server/"
rsync -a --no-owner --no-group --delete --exclude .git --exclude target/ --exclude logs/ \
"${WORKSPACE}/sdk/java-client/" "${BUILD_ROOT}/sdk/java-client/"
# Java contract tests share fixtures with the other SDKs via ../testdata.
rsync -a --no-owner --no-group --delete \
"${WORKSPACE}/sdk/testdata/" "${BUILD_ROOT}/sdk/testdata/"
rsync -a --no-owner --no-group --delete --exclude target/ \
"${ROOT}/init/" "${BUILD_ROOT}/openrec/init/"
rsync -a --no-owner --no-group --delete --exclude target/ \
"${ROOT}/web/" "${BUILD_ROOT}/openrec/web/"
run_maven -f "${BUILD_ROOT}/rec-server/pom.xml" clean install -DskipTests
mkdir -p "${BUILD_ROOT}/rec-server/server/plugins"
cp "${BUILD_ROOT}/rec-server/contrib/target/rec-contrib-0.2.0.jar" \
"${BUILD_ROOT}/rec-server/server/plugins/"
run_maven -f "${BUILD_ROOT}/rec-server/pom.xml" \
-pl graph,proto,contrib test
run_maven -f "${BUILD_ROOT}/rec-server/pom.xml" \
-pl server test \
-Dtest=ServingGraphServiceTest,RecallStoreUnitTest,KafkaServiceUnitTest,ControllerAndServiceUnitTest
run_maven -f "${BUILD_ROOT}/sdk/java-client/pom.xml" clean install
run_maven -f "${BUILD_ROOT}/openrec/init/pom.xml" clean verify
run_maven -f "${BUILD_ROOT}/openrec/web/pom.xml" clean verify