Skip to content

Commit

Permalink
Merge pull request #61 from theohbrothers/enhancement/bump-imap-backu…
Browse files Browse the repository at this point in the history
…p-14.4-variants-to-14.4.5

Enhancement: Bump imap-backup 14.4 variants to 14.4.5
  • Loading branch information
theohbrothersbot authored Nov 25, 2023
2 parents 7834d87 + 1e5b953 commit d9ef7d0
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 31 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: |
git diff --exit-code
build-14-4-4:
build-14-4-5:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -64,9 +64,9 @@ jobs:
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-14.4.4-${{ github.sha }}
key: ${{ runner.os }}-buildx-14.4.5-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-14.4.4-
${{ runner.os }}-buildx-14.4.5-
${{ runner.os }}-buildx-
- name: Login to Docker Hub registry
Expand All @@ -79,7 +79,7 @@ jobs:

# This step generates the docker tags
- name: Prepare
id: prep-14-4-4
id: prep-14-4-5
run: |
set -e
Expand All @@ -92,7 +92,7 @@ jobs:
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="14.4.4"
VARIANT="14.4.5"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
Expand All @@ -102,45 +102,45 @@ jobs:
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: 14.4.4 - Build (PRs)
- name: 14.4.5 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
with:
context: variants/14.4.4
context: variants/14.4.5
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: false
tags: |
${{ github.repository }}:${{ steps.prep-14-4-4.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-4.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-5.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-5.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 14.4.4 - Build and push (master)
- name: 14.4.5 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: variants/14.4.4
context: variants/14.4.5
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-14-4-4.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-4.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-5.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-5.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 14.4.4 - Build and push (release)
- name: 14.4.5 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
with:
context: variants/14.4.4
context: variants/14.4.5
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-14-4-4.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-4.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-4.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-5.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-5.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-14-4-5.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
Expand Down Expand Up @@ -3011,7 +3011,7 @@ jobs:
update-draft-release:
needs:
- build-14-4-4
- build-14-4-5
- build-14-3-0
- build-14-2-0
- build-14-1-1
Expand Down Expand Up @@ -3049,7 +3049,7 @@ jobs:

publish-draft-release:
needs:
- build-14-4-4
- build-14-4-5
- build-14-3-0
- build-14-2-0
- build-14-1-1
Expand Down Expand Up @@ -3089,7 +3089,7 @@ jobs:

update-dockerhub-description:
needs:
- build-14-4-4
- build-14-4-5
- build-14-3-0
- build-14-2-0
- build-14-1-1
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ imap-backup syncs IMAP as `.mbox` backup files, in contrast to [isync](https://g

| Tag | Dockerfile Build Context |
|:-------:|:---------:|
| `:14.4.4`, `:latest` | [View](variants/14.4.4) |
| `:14.4.5`, `:latest` | [View](variants/14.4.5) |
| `:14.3.0` | [View](variants/14.3.0) |
| `:14.2.0` | [View](variants/14.2.0) |
| `:14.1.1` | [View](variants/14.1.1) |
Expand Down Expand Up @@ -47,7 +47,7 @@ See the following `docker-compose` examples:

```sh
# Print command line usage
docker run --rm -it theohbrothers/docker-imap-backup:14.4.4 help
docker run --rm -it theohbrothers/docker-imap-backup:14.4.5 help

# Interactive setup. See: https://github.com/joeyates/imap-backup/blob/main/docs/commands/setup.md
# 1. add account
Expand All @@ -58,28 +58,28 @@ docker run --rm -it theohbrothers/docker-imap-backup:14.4.4 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:14.4.4 setup
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.5 setup

# View backup config
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.4 cat /root/.imap-backup/config.json
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.5 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:14.4.4 backup
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.5 backup

# Check backup integrity (not available on <= 9.2.0)
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.4 local check
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.5 local check

# Print backup stats
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.4 stats <email>
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.5 stats <email>

# 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:14.4.4 ls -alR /root/.imap-backup
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.5 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 <email>

# Start a shell
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.4 sh
docker run --rm -it -v imap-backup:/root/.imap-backup theohbrothers/docker-imap-backup:14.4.5 sh
```

## Development
Expand Down
2 changes: 1 addition & 1 deletion generate/definitions/versions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"imap-backup": {
"versions": [
"14.4.4",
"14.4.5",
"14.3.0",
"14.2.0",
"14.1.1",
Expand Down
13 changes: 13 additions & 0 deletions variants/14.4.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ruby:3.2-alpine3.17

RUN apk add --no-cache ca-certificates
RUN set -eux; \
gem install imap-backup -v 14.4.5; \
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" ]
13 changes: 13 additions & 0 deletions variants/14.4.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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$"; then
exec imap-backup "$@"
fi
else
exec imap-backup "$@"
fi

exec "$@"

0 comments on commit d9ef7d0

Please sign in to comment.