-
Notifications
You must be signed in to change notification settings - Fork 13
/
sync-keycloak-sources.sh
executable file
·46 lines (38 loc) · 1.14 KB
/
sync-keycloak-sources.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
#!/bin/bash -e
function echo_header() {
echo ""
echo "======================================================================="
echo "$1"
echo "-----------------------------------------------------------------------"
echo ""
}
function error() {
echo "======================================================================="
echo "Error"
echo "-----------------------------------------------------------------------"
echo "$1"
echo ""
exit 1
}
function syncFiles() {
MODULE=$1;
echo_header "Syncing files in the module $MODULE";
cd $MODULE
# Remove the existing files before sync
rm -rf src/main/java/*
rm -rf src/main/resources/*
mvn clean install -Psync
mv target/unpacked/* src/main/java/
if [ -d target/unpacked-resources -a ! -z "$(ls -A target/unpacked-resources/* 2>/dev/null)" ]
then
mv target/unpacked-resources/* src/main/resources/
fi
cd ..
}
# Check if inside keycloak-client directory
if [[ ! $PWD == *keycloak-client ]]; then
error "The script is supposed to be executed in the root of 'keycloak-client' repository";
fi;
syncFiles client-common-synced
syncFiles admin-client
syncFiles authz-client