docker_helper: added container_link_and_run_command_DOCKER_ARGS allowing users to specify docker env parameters in container_link_and_run_command

This commit is contained in:
Sameer Naik
2015-11-09 19:11:10 +05:30
parent 2747d1ee29
commit 4c8b596095
2 changed files with 3 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ POSTGRESQL_REPLICATION_PASSWORD=repl_password
# source the helper script
APP_NAME=postgresql
container_link_and_run_command_DOCKER_ARGS="-e PGPASSWORD=$POSTGRESQL_PASSWORD"
load tests/docker_helper
# Link to container and execute command

View File

@@ -13,6 +13,7 @@
# VOL_PREFIX - prefix of volumes inside the container (default: /bitnami/$APP_NAME)
# VOLUMES - colon separated list of container volumes (default: $VOL_PREFIX/data:$VOL_PREFIX/conf:$VOL_PREFIX/logs)
# HOST_VOL_PREFIX - prefix of volumes mounted from the host (default: /tmp/bitnami/$CONTAINER_NAME)
# container_link_and_run_command_DOCKER_ARGS - optional arguments passed to docker run in container_link_and_run_command (default: none)
##
CONTAINER_NAME=bitnami-$APP_NAME-test
@@ -164,5 +165,5 @@ container_link() {
# ${@:2}: command to execute
container_link_and_run_command() {
# launch command as the entrypoint to skip the s6 init sequence (speeds up the tests)
docker run --rm $(container_link $1 $APP_NAME) --entrypoint ${2} $IMAGE_NAME "${@:3}"
docker run --rm $(container_link $1 $APP_NAME) $container_link_and_run_command_DOCKER_ARGS --entrypoint ${2} $IMAGE_NAME "${@:3}"
}