make sure there's only one container
Some checks reported errors
continuous-integration/drone/pr Build was killed
Some checks reported errors
continuous-integration/drone/pr Build was killed
This commit is contained in:
parent
c7ed9bfb4a
commit
d39f86d053
@ -41,6 +41,13 @@ run_docker_cp() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
NEWL=$(echo "$CONTAINER" | grep -c '$')
|
||||||
|
if [[ $NEWL != 1 ]]; then
|
||||||
|
echo "There are $NEWL containers running with the name $PLUGIN_SERVICE. I don't know which one should i copy your files to. Check your containers and stop the unnecessary ones, then restart this script."
|
||||||
|
echo -e "Containers digests: \n$CONTAINER"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
CD=""
|
CD=""
|
||||||
if [ -n "$PLUGIN_CHDIR" ]; then
|
if [ -n "$PLUGIN_CHDIR" ]; then
|
||||||
CD="-C $PLUGIN_CHDIR"
|
CD="-C $PLUGIN_CHDIR"
|
||||||
@ -49,7 +56,7 @@ run_docker_cp() {
|
|||||||
echo "Copying $PLUGIN_SOURCE"
|
echo "Copying $PLUGIN_SOURCE"
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
tar cf - $CD $PLUGIN_SOURCE | docker -H "$REMOTE_DOCKER_HOST" cp - $CONTAINER:$PLUGIN_DEST
|
tar cf - $CD $PLUGIN_SOURCE | docker -H "$REMOTE_DOCKER_HOST" cp - $CONTAINER:$PLUGIN_DEST
|
||||||
|
|
||||||
echo "--- start exec ---"
|
echo "--- start exec ---"
|
||||||
if [ -n "$PLUGIN_EXEC" ]; then
|
if [ -n "$PLUGIN_EXEC" ]; then
|
||||||
docker -H "$REMOTE_DOCKER_HOST" exec "$CONTAINER" sh -c "$PLUGIN_EXEC"
|
docker -H "$REMOTE_DOCKER_HOST" exec "$CONTAINER" sh -c "$PLUGIN_EXEC"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user