From 118cb1017a63281fb4dbef4e0959388cc9aacae6 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 22 Nov 2022 18:37:15 +0100 Subject: [PATCH 1/2] Add new action Build mailcow backup image --- .github/workflows/rebuild_backup_image.yml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/rebuild_backup_image.yml diff --git a/.github/workflows/rebuild_backup_image.yml b/.github/workflows/rebuild_backup_image.yml new file mode 100644 index 00000000..120d68d9 --- /dev/null +++ b/.github/workflows/rebuild_backup_image.yml @@ -0,0 +1,34 @@ +name: Build mailcow backup image + +on: + schedule: + # At 00:00 on Sunday + - cron: "0 0 * * 0" + workflow_dispatch: # Allow to run workflow manually + +jobs: + docker_image_build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.BACKUPIMAGEBUILD_ACTION_DOCKERHUB_USERNAME }} + password: ${{ secrets.BACKUPIMAGEBUILD_ACTION_DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + file: data/Dockerfiles/backup/Dockerfile + push: true + tags: mailcow/backup:latest From ff7102468ee0db49d866301aecc03690f69f1191 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 22 Nov 2022 18:38:38 +0100 Subject: [PATCH 2/2] [Helper] Backup and restore: Use latest tag for image --- helper-scripts/backup_and_restore.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helper-scripts/backup_and_restore.sh b/helper-scripts/backup_and_restore.sh index 1853f501..ee9f0202 100755 --- a/helper-scripts/backup_and_restore.sh +++ b/helper-scripts/backup_and_restore.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -DEBIAN_DOCKER_IMAGE="mailcow/backup:1.0" +DEBIAN_DOCKER_IMAGE="mailcow/backup:latest" if [[ ! -z ${MAILCOW_BACKUP_LOCATION} ]]; then BACKUP_LOCATION="${MAILCOW_BACKUP_LOCATION}" @@ -58,7 +58,7 @@ if ! [[ "${THREADS}" =~ ^[1-9]+$ ]] ; then echo "Thread input is not a number!" exit 1 elif [[ "${THREADS}" =~ ^[1-9]+$ ]] ; then - echo "Using ${THREADS} Thread(s) for this run." + echo "Using ${THREADS} Thread(s) for this run." echo "Notice: You can set the Thread count with the THREADS Variable before you run this script." fi @@ -181,7 +181,7 @@ function restore() { elif [ "${DOCKER_COMPOSE_VERSION}" == "standalone" ]; then COMPOSE_COMMAND="docker-compose" - + else echo -e "\e[31mCan not read DOCKER_COMPOSE_VERSION variable from mailcow.conf! Is your mailcow up to date? Exiting...\e[0m" exit 1 @@ -380,4 +380,4 @@ elif [[ ${1} == "restore" ]]; then done echo "Restoring ${FILE_SELECTION[${input_sel}]} from ${RESTORE_POINT}..." restore "${RESTORE_POINT}" ${FILE_SELECTION[${input_sel}]} -fi \ No newline at end of file +fi