Skip to content

Commit bb7b865

Browse files
authored
Merge pull request #172 from WadeBarnes/docker-compose-fixes
Update the remaining direct calls to docker compose
2 parents f041c11 + 2e06da1 commit bb7b865

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

manage

+5-3
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ function generateSecrets() {
450450
function backup() {
451451
(
452452
_msg=$@
453-
volumes=$(docker -l ERROR compose config --volumes)
453+
volumes=$(${dockerCompose} config --volumes)
454454
timeStamp=`date +\%Y-\%m-\%d_%H-%M-%S`
455455
datePart=${timeStamp%%_*}
456456
timePart=${timeStamp#*_}
@@ -462,6 +462,7 @@ function backup() {
462462
fi
463463

464464
for volume in ${volumes}; do
465+
volume=$(echo ${volume} |sed 's~\r$~~')
465466
sourceVolume=${COMPOSE_PROJECT_NAME}_${volume}
466467
archiveName=${sourceVolume}_${timeStamp}.tar.gz
467468
archivePath="/${backupDir}/${archiveName}"
@@ -487,8 +488,9 @@ function restore() {
487488
archiveSuffix="${datePart}_${timePart}"
488489

489490
if promptForConfirmation "You are about to restore from the '${archiveDirectory}' backup set.\nYour existing data will be lost if not backed up first."; then
490-
volumes=$(docker -l ERROR compose config --volumes)
491+
volumes=$(${dockerCompose} config --volumes)
491492
for volume in ${volumes}; do
493+
volume=$(echo ${volume} |sed 's~\r$~~')
492494
targetVolume=${COMPOSE_PROJECT_NAME}_${volume}
493495
archiveName=${targetVolume}_${archiveSuffix}
494496
archivePath="${archiveDirectory}/${archiveName}"
@@ -626,7 +628,7 @@ function deleteVolumes() {
626628
_projectName=${COMPOSE_PROJECT_NAME:-docker}
627629

628630
echoYellow \\n"Stopping and removing any running containers ..."
629-
docker -l ERROR compose down -v
631+
${dockerCompose} down -v
630632

631633
_pattern="^${_projectName}_\|^docker_"
632634
_volumes=$(docker volume ls -q | grep ${_pattern})

0 commit comments

Comments
 (0)