Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from testcontainers/multi-line-cmd
Browse files Browse the repository at this point in the history
Support multiple cmd entries
  • Loading branch information
rnorth authored Mar 4, 2019
2 parents 1b90eae + 115ca4c commit b35709a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
set -euo pipefail # Abort on error, strict variable interpolation, fail if piped command fails
IMAGE_CACHE_DIR=${CI_WORKSPACE}/.dind

if [[ "${PLUGIN_CMD:-}" == "" ]]; then
echo "One or more cmd arguments must be provided"
exit 1
fi
# If multiple cmd lines have been provided, chain them into something which we can execute with sh
# Note that Drone provides these lines in comma separated form without escaping, which means commas in commands are known to break
export PLUGIN_CMD=${PLUGIN_CMD//,/ && }

# Wrap command scriptlet in an invocation of sh
export PLUGIN_CMD="sh -c '${PLUGIN_CMD}'"

echo "📦 Starting dind-drone-plugin"

echo "🐳 Starting docker-in-docker daemon"
Expand Down

0 comments on commit b35709a

Please sign in to comment.