Skip to content

Commit

Permalink
#57 Collect and return error codes from duplicity commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen Bleul committed Oct 27, 2018
1 parent 1005ab8 commit d6705b1
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 6 deletions.
2 changes: 1 addition & 1 deletion buildscripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
#------------------
# CONTAINER VARIABLES
#------------------
export IMAGE_VERSION=1.3.2
export IMAGE_VERSION=1.4.2
export BUILD_BRANCH=$(git branch | grep -e "^*" | cut -d' ' -f 2)
9 changes: 8 additions & 1 deletion scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ set -o errexit

source /opt/volumerize/base.sh

DUPLICITY_RETURN_CODE=0

function backup() {
${DUPLICITY_COMMAND} $@ ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_SOURCE} ${VOLUMERIZE_TARGET} || DUPLICITY_RETURN_CODE=$? && true ;
}

${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy preAction backup
source ${VOLUMERIZE_SCRIPT_DIR}/stopContainers.sh
${DUPLICITY_COMMAND} $@ ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_SOURCE} ${VOLUMERIZE_TARGET} || true
backup $@
source ${VOLUMERIZE_SCRIPT_DIR}/startContainers.sh
${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy postAction backup
exit $DUPLICITY_RETURN_CODE
9 changes: 8 additions & 1 deletion scripts/backupFull
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ set -o errexit

source /opt/volumerize/base.sh

DUPLICITY_RETURN_CODE=0

function backupFull() {
${DUPLICITY_COMMAND} full $@ ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_SOURCE} ${VOLUMERIZE_TARGET} || DUPLICITY_RETURN_CODE=$? && true ;
}

${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy preAction backup
source ${VOLUMERIZE_SCRIPT_DIR}/stopContainers.sh
${DUPLICITY_COMMAND} full $@ ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_SOURCE} ${VOLUMERIZE_TARGET} || true
backupFull $@
source ${VOLUMERIZE_SCRIPT_DIR}/startContainers.sh
${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy postAction backup
exit $DUPLICITY_RETURN_CODE
9 changes: 8 additions & 1 deletion scripts/backupIncremental
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ set -o errexit

source /opt/volumerize/base.sh

DUPLICITY_RETURN_CODE=0

function backupIncremental() {
${DUPLICITY_COMMAND} incremental $@ ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_SOURCE} ${VOLUMERIZE_TARGET} || DUPLICITY_RETURN_CODE=$? && true ;
}

${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy preAction backup
source ${VOLUMERIZE_SCRIPT_DIR}/stopContainers.sh
${DUPLICITY_COMMAND} incremental $@ ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_SOURCE} ${VOLUMERIZE_TARGET} || true
backupIncremental $@
source ${VOLUMERIZE_SCRIPT_DIR}/startContainers.sh
${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy postAction backup
exit $DUPLICITY_RETURN_CODE
9 changes: 8 additions & 1 deletion scripts/periodicBackup
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ set -o errexit

source /opt/volumerize/base.sh

DUPLICITY_RETURN_CODE=0

function periodicBackup() {
${DUPLICITY_COMMAND} $@ ${DUPLICITY_MODE} ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_SOURCE} ${VOLUMERIZE_TARGET} || DUPLICITY_RETURN_CODE=$? && true ;
}

${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy preAction backup
source ${VOLUMERIZE_SCRIPT_DIR}/stopContainers.sh
${DUPLICITY_COMMAND} $@ ${DUPLICITY_MODE} ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_SOURCE} ${VOLUMERIZE_TARGET}
periodicBackup $@
source ${VOLUMERIZE_SCRIPT_DIR}/startContainers.sh
${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy postAction backup
exit $DUPLICITY_RETURN_CODE
9 changes: 8 additions & 1 deletion scripts/restore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ set -o errexit

source /opt/volumerize/base.sh

DUPLICITY_RETURN_CODE=0

function restore() {
${DUPLICITY_COMMAND} restore --force $@ ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_TARGET} ${VOLUMERIZE_SOURCE} || DUPLICITY_RETURN_CODE=$? && true ;
}

${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy preAction restore
source ${VOLUMERIZE_SCRIPT_DIR}/stopContainers.sh
${DUPLICITY_COMMAND} restore --force $@ ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_TARGET} ${VOLUMERIZE_SOURCE} || true
restore $@
source ${VOLUMERIZE_SCRIPT_DIR}/startContainers.sh
${VOLUMERIZE_SCRIPT_DIR}/prepoststrategy postAction restore
exit $DUPLICITY_RETURN_CODE

0 comments on commit d6705b1

Please sign in to comment.