lib/minke/scripts/minke in minke-1.14.5 vs lib/minke/scripts/minke in minke-1.15.0
- old
+ new
@@ -1,8 +1,8 @@
#!/bin/bash
-MINKE_VERSION="1.14.5"
+MINKE_VERSION="1.15.0"
DOCKER_SOCK="/var/run/docker.sock:/var/run/docker.sock"
NEW_UUID=$(base64 /dev/urandom | tr -d '/+' | head -c 32 | tr '[:upper:]' '[:lower:]')
DOCKER_IMAGE="nicholasjackson/minke:${MINKE_VERSION}"
COMMAND=$*
@@ -27,10 +27,18 @@
fi
# Test if interactive terminal and set the flag
[[ -t 1 ]] && IT="-it" || IT=""
+# Do we need to forward an ssh key for encrypt?
+MOUNT_VOLUME=""
+while getopts 'Avm:v' flag; do
+ if [[ $flag == "m" ]]; then
+ SSH_KEY="-v ${OPTARG}"
+ fi
+done
+
if [[ $1 != \generate* ]]; then
# Test if we need to mount any special volumes for paths specified in the Gemfile
while read -r line; do
if [[ $line != \#* ]]; then
l=$(echo $line | sed "s/.*:path *=> *//" | sed "s/['|\"]\(.*\)['|\"]/\1/")
@@ -38,10 +46,10 @@
fi
done < <(grep :path Gemfile)
DIR=$(dirname `pwd`)
- DOCKER_RUN="docker run ${IT} --rm --net=minke_${NEW_UUID} ${SSH_AUTH} ${GEM_VOLUMES} -v ${DOCKER_SOCK} -v ${DIR}:${DIR} -e BUNDLE_PATH=${PWD}/vendor -e BUNDLE_JOBS=2 -e DOCKER_NETWORK=minke_${NEW_UUID} -w ${DIR}/_minke ${DOCKER_IMAGE} ${COMMAND}"
+ DOCKER_RUN="docker run ${IT} --rm --net=minke_${NEW_UUID} ${SSH_AUTH} ${GEM_VOLUMES} ${SSH_KEY} -v ${DOCKER_SOCK} -v ${DIR}:${DIR} -e BUNDLE_PATH=${PWD}/vendor -e BUNDLE_JOBS=2 -e DOCKER_NETWORK=minke_${NEW_UUID} -w ${DIR}/_minke ${DOCKER_IMAGE} ${COMMAND}"
echo "Running command: minke ${COMMAND}"
id=$(docker network create minke_${NEW_UUID})
eval "${DOCKER_RUN}"
id=$(docker network rm minke_${NEW_UUID})