diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 75f66f4..427e9a6 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -33,7 +33,7 @@ jobs: run: | git diff --exit-code - build-15-0-1: + build-15-0-2: runs-on: ubuntu-latest steps: - name: Checkout @@ -64,9 +64,9 @@ jobs: uses: actions/cache@v4 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-15.0.1-${{ github.sha }} + key: ${{ runner.os }}-buildx-15.0.2-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx-15.0.1- + ${{ runner.os }}-buildx-15.0.2- ${{ runner.os }}-buildx- - name: Login to Docker Hub registry @@ -79,7 +79,7 @@ jobs: # This step generates the docker tags - name: Prepare - id: prep-15-0-1 + id: prep-15-0-2 run: | set -e @@ -92,7 +92,7 @@ jobs: # Generate docker image tags # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' # E.g. 'master-' and 'master-abc0123-' - VARIANT="15.0.1" + VARIANT="15.0.2" REF_VARIANT="${REF}-${VARIANT}" REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" @@ -102,45 +102,45 @@ jobs: echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT - - name: 15.0.1 - Build (PRs) + - name: 15.0.2 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' uses: docker/build-push-action@v5 with: - context: variants/15.0.1 + context: variants/15.0.2 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x push: false tags: | - ${{ github.repository }}:${{ steps.prep-15-0-1.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-15-0-1.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-15-0-2.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-15-0-2.outputs.REF_SHA_VARIANT }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - name: 15.0.1 - Build and push (master) + - name: 15.0.2 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' uses: docker/build-push-action@v5 with: - context: variants/15.0.1 + context: variants/15.0.2 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x push: true tags: | - ${{ github.repository }}:${{ steps.prep-15-0-1.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-15-0-1.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-15-0-2.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-15-0-2.outputs.REF_SHA_VARIANT }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - name: 15.0.1 - Build and push (release) + - name: 15.0.2 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') uses: docker/build-push-action@v5 with: - context: variants/15.0.1 + context: variants/15.0.2 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x push: true tags: | - ${{ github.repository }}:${{ steps.prep-15-0-1.outputs.VARIANT }} - ${{ github.repository }}:${{ steps.prep-15-0-1.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-15-0-1.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-15-0-2.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-15-0-2.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-15-0-2.outputs.REF_SHA_VARIANT }} ${{ github.repository }}:latest cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max @@ -3368,7 +3368,7 @@ jobs: update-draft-release: needs: - - build-15-0-1 + - build-15-0-2 - build-14-6-1 - build-14-5-2 - build-14-4-5 @@ -3409,7 +3409,7 @@ jobs: publish-draft-release: needs: - - build-15-0-1 + - build-15-0-2 - build-14-6-1 - build-14-5-2 - build-14-4-5 @@ -3452,7 +3452,7 @@ jobs: update-dockerhub-description: needs: - - build-15-0-1 + - build-15-0-2 - build-14-6-1 - build-14-5-2 - build-14-4-5 diff --git a/README.md b/README.md index 5d2bcbe..e00b880 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ imap-backup syncs IMAP as `.mbox` backup files, in contrast to [isync](https://g | Tag | Dockerfile Build Context | |:-------:|:---------:| -| `:15.0.1`, `:latest` | [View](variants/15.0.1) | +| `:15.0.2`, `:latest` | [View](variants/15.0.2) | | `:14.6.1` | [View](variants/14.6.1) | | `:14.5.2` | [View](variants/14.5.2) | | `:14.4.5` | [View](variants/14.4.5) | @@ -50,7 +50,7 @@ See the following `docker-compose` examples: ```sh # Print command line usage -docker run --rm -it theohbrothers/docker-imap-backup:15.0.1 help +docker run --rm -it theohbrothers/docker-imap-backup:15.0.2 help # Interactive setup. See: https://github.com/joeyates/imap-backup/blob/main/docs/commands/setup.md # 1. add account @@ -61,28 +61,28 @@ docker run --rm -it theohbrothers/docker-imap-backup:15.0.1 help # 5. test connection # 13. Press (q) return to main menu # 3. save and exit -docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.1 setup +docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.2 setup # View backup config -docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.1 cat /root/.imap-backup/config.json +docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.2 cat /root/.imap-backup/config.json # Backup. See: https://github.com/joeyates/imap-backup/blob/main/docs/commands/backup.md -docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.1 backup +docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.2 backup # Check backup integrity (not available on <= 9.2.0) -docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.1 local check +docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.2 local check # Print backup stats -docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.1 stats +docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.2 stats # List backup files. See: https://github.com/joeyates/imap-backup/blob/main/docs/commands/backup.md -docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.1 ls -alR /root/.imap-backup +docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.2 ls -alR /root/.imap-backup # Restore emails from backup to IMAP server. See: https://github.com/joeyates/imap-backup/blob/main/docs/commands/restore.md docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:9.3.1 restore # Start a shell -docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.1 sh +docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:15.0.2 sh ``` ## Development diff --git a/generate/definitions/versions.json b/generate/definitions/versions.json index a9c36c8..861f95f 100644 --- a/generate/definitions/versions.json +++ b/generate/definitions/versions.json @@ -1,7 +1,7 @@ { "imap-backup": { "versions": [ - "15.0.1", + "15.0.2", "14.6.1", "14.5.2", "14.4.5", diff --git a/variants/15.0.2/Dockerfile b/variants/15.0.2/Dockerfile new file mode 100644 index 0000000..7423cec --- /dev/null +++ b/variants/15.0.2/Dockerfile @@ -0,0 +1,15 @@ +FROM ruby:3.2-alpine3.17 + +RUN apk add --no-cache ca-certificates +RUN set -eux; \ + apk add --no-cache alpine-sdk; \ + gem install imap-backup -v 15.0.2; \ + apk del --no-cache alpine-sdk; \ + imap-backup help > /dev/null + +WORKDIR /root +VOLUME /root/.imap-backup + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x /docker-entrypoint.sh +ENTRYPOINT [ "/docker-entrypoint.sh" ] \ No newline at end of file diff --git a/variants/15.0.2/docker-entrypoint.sh b/variants/15.0.2/docker-entrypoint.sh new file mode 100644 index 0000000..dc99016 --- /dev/null +++ b/variants/15.0.2/docker-entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -eu + +if [ $# -gt 0 ]; then + SUBCOMMANDS=$( imap-backup help | grep -E '^\s*imap-backup' | awk '{print $2}' | sort -n | uniq ) + if echo "$SUBCOMMANDS" | grep "^$1$" > /dev/null; then + exec imap-backup "$@" + fi +else + exec imap-backup "$@" +fi + +exec "$@"