forked from fbascheper/SoapUI-MockService-Docker-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-entrypoint.sh
executable file
·59 lines (47 loc) · 1.86 KB
/
docker-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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
#
# Default usage: docker-entrypoint.sh start-soapui
#
# ==> Note: for the SoapUI command reference see http://www.soapui.org/test-automation/running-from-command-line/soap-mock.html
#
# Default value of environment variables:
# PROJECT = $SOAPUI_PRJ/default-soapui-project.xml
# MOCK_SERVICE_PATH = << unset >> ; this implies that the path in the mockservice itself is used
#
#
# The following enviroment variable is required (and has no default value)
# MOCK_SERVICE_NAME = << unset >>
#
#
# Run entrypoint scripts of dependent docker containers
#
if [ -d /docker-entrypoint-initdb.d ]; then
for f in /docker-entrypoint-initdb.d/*.sh; do
[ -f "$f" ] && . "$f"
done
fi
#
# Setup default values for environment variables.
#
if [ -z "$PROJECT" ]; then
export PROJECT=$SOAPUI_PRJ/default-soapui-project.xml
fi
if [ -z "$MOCK_SERVICE_NAME" ]; then
echo "Enviromentment variable MOCK_SERVICE_NAME should have been set explicitly (e.g. by -e MOCK_SERVICE_NAME=BLZ-SOAP11-MockService"
exit 1
fi
export PATH=$SOAPUI_DIR/bin:$PATH
cd $SOAPUI_PRJ
if [ "$1" = 'start-soapui' ]; then
if [ -z "$MOCK_SERVICE_PATH" ]; then
echo "Starting Mock-service=$MOCK_SERVICE_NAME using default mockservice url-path from SoapUI-project=$PROJECT"
exec gosu soapui mockservicerunner.sh -Djava.awt.headless=true -p 8080 -m $MOCK_SERVICE_NAME $PROJECT </dev/null
else
echo "Starting Mock-service=$MOCK_SERVICE_NAME using url-path=$MOCK_SERVICE_PATH from SoapUI-project=$PROJECT"
exec gosu soapui mockservicerunner.sh -Djava.awt.headless=true -p 8080 -m $MOCK_SERVICE_NAME -a $MOCK_SERVICE_PATH $PROJECT </dev/null
fi
else
echo "You can start the Mock-service manually by running"
echo ">>> mockservicerunner.sh -Djava.awt.headless=true -p 8080 -m $MOCK_SERVICE_NAME $PROJECT"
exec gosu soapui "$@"
fi