forked from openedx-unsupported/devstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
in
executable file
·26 lines (22 loc) · 803 Bytes
/
in
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
#!/usr/bin/env bash
# Run a command in a service's container.
# Try to bring up the service if it isn't already up.
# Example:
# ~/devstack> ./in registrar ls /edx/app/
# edx_ansible nginx registrar supervisor
# Example 2:
# ~/devstack> ./in registrar "cd /edx/app/registrar && ls"
# data registrar registrar.sh venvs
# devstack.sh registrar_env registrar-workers.sh
# nodeenvs registrar_gunicorn.py staticfiles
set -e
set -o pipefail
set -u
service="$1"
shift
container_id=$(make --silent --no-print-directory dev.print-container."$service")
if [[ -z "$container_id" ]]; then
make --silent --no-print-directory dev.up."$service"
container_id=$(make --silent --no-print-directory dev.print-container."$service")
fi
docker exec -it "$container_id" bash -c "$*"