-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathentrypoint.sh
32 lines (26 loc) · 1.06 KB
/
entrypoint.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
#!/bin/bash
sleep 5
export DOCKER_HASH_ID=$( kubectl get pod "$HOSTNAME" -n "$NS" -o jsonpath='{.status.containerStatuses[*].imageID}' | sed 's/ /\n/g' | grep -v 'istio' | sed 's/docker\-pullable\:\/\///g' )
if [[ -z $DOCKER_HASH_ID ]]; then
echo "DOCKER_HASH_ID IS EMPTY;EXITING";
exit 1;
fi
echo "DOCKER_HASH_ID ; $DOCKER_HASH_ID"
# Find files and enclose their paths in quotes
files=$(find /tmp/profile_resource -type f -exec bash -c 'printf "%q\n" "$1"' _ {} \;)
# Set IFS to handle newline as the delimiter
IFS=$'\n'
# Iterate over the files
for file in $files; do
dir_name=$(dirname $file | sed 's/\/tmp\///g');
file="$( echo $file | sed 's/\\ / /g' )"
file_name=$(basename $file)
echo "file $file file_name: $file_name"
echo "DIRECTORY : $dir_name and MOUNT PATH : $mountPath/$dir_name";
mkdir -p "$mountPath/$dir_name";
cp "$file" "$mountPath/$dir_name/$file_name";
done
# Reset IFS to its default value
IFS=$' \t\n'
java --version
java -Dfile.encoding=UTF-8 -jar dslrig-packetcreator-*.jar --spring.config.location=./config/application.properties