You are here

exec.sh in Realistic Dummy Content 8.2

#/bin/bash
#
# Runs a command on a throwaway container.
# Use this instead of exec, because we want to avoid "polluting" our
# containers with exec, and the LXC driver used by Circle does not support
# exec.
#
set -e

# Used in ./lib/prepare-run.source, below
export COMPOSERCONTAINER=drupal8

if [ -z "$1" ]; then
  echo 'Please specify a command to run.'
  exit 1
fi
COMMAND="$1"

source ./lib/prepare-run.source

# We are linking the names of the containers in the context of the network,
# not the absolute container names that we can retrieve via docker ps.
docker run \
  -v "$(pwd)"/../:/var/www/html/modules/realistic_dummy_content \
  -v "$(pwd)"/tmp/drupal8:/var/www/html/sites/default \
  --link database:database \
  -w /var/www/html \
  --net "$NETWORK" \
  "$IMAGE" /bin/bash -c "$COMMAND"

File

developer/frameworks/drupal8/exec.sh
View source
  1. #/bin/bash
  2. #
  3. # Runs a command on a throwaway container.
  4. # Use this instead of exec, because we want to avoid "polluting" our
  5. # containers with exec, and the LXC driver used by Circle does not support
  6. # exec.
  7. #
  8. set -e
  9. # Used in ./lib/prepare-run.source, below
  10. export COMPOSERCONTAINER=drupal8
  11. if [ -z "$1" ]; then
  12. echo 'Please specify a command to run.'
  13. exit 1
  14. fi
  15. COMMAND="$1"
  16. source ./lib/prepare-run.source
  17. # We are linking the names of the containers in the context of the network,
  18. # not the absolute container names that we can retrieve via docker ps.
  19. docker run \
  20. -v "$(pwd)"/../:/var/www/html/modules/realistic_dummy_content \
  21. -v "$(pwd)"/tmp/drupal8:/var/www/html/sites/default \
  22. --link database:database \
  23. -w /var/www/html \
  24. --net "$NETWORK" \
  25. "$IMAGE" /bin/bash -c "$COMMAND"