-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathcore_service.sh
More file actions
executable file
·53 lines (48 loc) · 2.05 KB
/
Copy pathcore_service.sh
File metadata and controls
executable file
·53 lines (48 loc) · 2.05 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
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
# This startup script is meant to be invoked from within a Docker container
# started by docker-compose_dss.yaml, not on a local system.
DEBUG_ON=${1:-0}
# POSIX compliant test to check if with-yugabyte profile is enabled.
if [ "${COMPOSE_PROFILES#*"with-yugabyte"}" != "${COMPOSE_PROFILES}" ]; then
echo "Using Yugabyte"
DATASTORE_CONNECTION="-datastore_host local-dss-ybdb -datastore_user yugabyte --datastore_port 5433"
else
if [ "${COMPOSE_PROFILES#*"with-raft"}" != "${COMPOSE_PROFILES}" ]; then
echo "Using raft"
DATASTORE_CONNECTION="-store_type raft -raft_node_id=1 -rid_raft_peers=1=http://127.0.0.1:9011 -scd_raft_peers=1=http://127.0.0.1:9021 -aux_raft_peers=1=http://127.0.0.1:9031 -raft_datadir /raftdata"
else
echo "Using CockroachDB"
DATASTORE_CONNECTION="-datastore_host local-dss-crdb"
fi
fi
if [ "$DEBUG_ON" = "1" ]; then
echo "Debug Mode: on"
# Linter is disabled to properly unwrap $DATASTORE_CONNECTION.
# shellcheck disable=SC2086
dlv --headless --listen=:4000 --api-version=2 --accept-multiclient exec --continue /usr/bin/core-service -- ${DATASTORE_CONNECTION} \
-public_key_files /var/test-certs/auth2.pem \
-log_format console \
-dump_requests \
-addr :8082 \
-accepted_jwt_audiences localhost,host.docker.internal,local-dss-core-service,dss_sandbox-local-dss-core-service-1,core-service \
-enable_scd \
-allow_http_base_urls \
-locality local_dev \
-public_endpoint http://127.0.0.1:8082
else
echo "Debug Mode: off"
# Use exec so docker-compose's SIGTERM is forwarded to the binary
# Linter is disabled to properly unwrap $DATASTORE_CONNECTION.
# shellcheck disable=SC2086
exec /usr/bin/core-service \
${DATASTORE_CONNECTION} \
-public_key_files /var/test-certs/auth2.pem \
-log_format console \
-dump_requests \
-addr :8082 \
-accepted_jwt_audiences localhost,host.docker.internal,local-dss-core-service,dss_sandbox-local-dss-core-service-1,core-service \
-enable_scd \
-allow_http_base_urls \
-locality local_dev \
-public_endpoint http://127.0.0.1:8082
fi