File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 2
2
set -e
3
3
trap ' error "$(printf "Command \`%s\` at $BASH_SOURCE:$LINENO failed with exit code $?" "$BASH_COMMAND")"' ERR
4
4
5
- # # find directory where this script is located following symlinks if neccessary
5
+ # # find directory where this script is located following symlinks if necessary
6
6
readonly WARDEN_DIR=" $(
7
7
cd " $(
8
8
dirname " $(
@@ -17,6 +17,7 @@ export readonly WARDEN_BIN="${WARDEN_DIR}/bin/warden"
17
17
export readonly DOCKER_COMPOSE_COMMAND=" ${DOCKER_COMPOSE_COMMAND:- " docker compose" } "
18
18
19
19
source " ${WARDEN_DIR} /utils/core.sh"
20
+ source " ${WARDEN_DIR} /utils/svc.sh"
20
21
source " ${WARDEN_DIR} /utils/env.sh"
21
22
22
23
# # verify docker is installed
Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ WARDEN_ENV_PATH="$(locateEnvPath)" || exit $?
5
5
loadEnvConfig " ${WARDEN_ENV_PATH} " || exit $?
6
6
assertDockerRunning
7
7
8
+ # # warn if global services are not running
9
+ if [[ " ${WARDEN_PARAMS[0]} " == " up" ]]; then
10
+ assertSvcRunning
11
+ fi
12
+
8
13
HOST_UID=$( id -u)
9
14
HOST_GID=$( id -g)
10
15
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ [[ ! ${WARDEN_DIR} ]] && >&2 echo -e " \033[31mThis script is not intended to be run directly!\033[0m" && exit 1
3
+
4
+ function assertSvcRunning() {
5
+ # # test for global services running
6
+ wardenNetworkName=$( cat ${WARDEN_DIR} /docker/docker-compose.yml | grep -A3 ' networks:' | tail -n1 | sed -e ' s/[[:blank:]]*name:[[:blank:]]*//g' )
7
+ wardenNetworkId=$( docker network ls -q --filter name=" ${wardenNetworkName} " )
8
+
9
+ if [[ -z " ${wardenNetworkId} " ]]; then
10
+ warning " Warden core services are not currently running.\033[0m Run \033[36mwarden svc up\033[0m to start Warden core services."
11
+ fi
12
+ }
You can’t perform that action at this time.
0 commit comments