forked from moravianlibrary/s2i-kramerius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
assemble
executable file
·39 lines (25 loc) · 997 Bytes
/
assemble
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 -e
function restore_saved_artifacts() {
if [ "$(ls /tmp/artifacts/.gradle 2>/dev/null)" ]; then
echo "Restoring saved artifacts from prior build..."
mv /tmp/artifacts/.gradle $HOME/.gradle
fi
}
# Source code provided to S2I is at ${HOME}
if [[ "$1" == "-h" ]]; then
exec /usr/libexec/s2i/usage
fi
export GRADLE_USER_HOME=${HOME}/.gradle
LOCAL_SOURCE_DIR=/tmp/src
DEPLOY_DIR=$CATALINA_HOME/webapps/
restore_saved_artifacts
pushd $LOCAL_SOURCE_DIR &> /dev/null
gradle --no-daemon :search:clean :search:build
gradle --no-daemon :client:clean :client:build
mkdir -p WEB-INF/lib
# Parallel solr migration
#curl -fsL https://github.com/pavel-stastny/solrmigration/releases/download/1.0/solrmigration.jar -o WEB-INF/lib/solrmigration.jar
#zip ./search/build/libs/search.war WEB-INF/lib/solrmigration.jar
mv ./search/build/libs/search.war $DEPLOY_DIR
mv ./client/build/libs/client.war $DEPLOY_DIR
mv ./security-core/build/libs/security-core.jar $CATALINA_HOME/lib/