Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Ian | 78d6fd7ff5 | |
GoliathLabs | 16d10e3fca | |
ViViDboarder | 428b9c1d8e | |
ViViDboarder | 4e6bc4022c | |
ViViDboarder | 27aa1fd059 | |
ViViDboarder | f4aa842dd3 | |
ViViDboarder | fd824fbf47 |
|
@ -0,0 +1,16 @@
|
|||
# Docs: <https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/customizing-dependency-updates>
|
||||
|
||||
version: 2
|
||||
|
||||
updates:
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule: {interval: monthly}
|
||||
reviewers: [ViViDboarder]
|
||||
assignees: [ViViDboarder]
|
||||
|
||||
- package-ecosystem: docker
|
||||
directory: /
|
||||
schedule: {interval: monthly}
|
||||
reviewers: [ViViDboarder]
|
||||
assignees: [ViViDboarder]
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
name: tests
|
||||
|
||||
"on":
|
||||
push:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run base tests
|
||||
run: make test-x86
|
||||
|
||||
- name: Run s3 tests
|
||||
run: make test-s3-x86
|
||||
|
||||
- name: Setup python
|
||||
uses: actions/setup-python@v2.2.2
|
||||
|
||||
- name: Run pre-commit hooks
|
||||
run: |
|
||||
pip install pre-commit
|
||||
make check
|
|
@ -26,4 +26,6 @@ COPY ./scripts /scripts
|
|||
|
||||
HEALTHCHECK CMD /scripts/healthcheck.sh
|
||||
|
||||
VOLUME /root/.config
|
||||
|
||||
CMD [ "/scripts/start.sh" ]
|
||||
|
|
4
Makefile
4
Makefile
|
@ -11,7 +11,7 @@ test: test-x86
|
|||
|
||||
.PHONY: build-x86
|
||||
build-x86:
|
||||
docker build -f ./Dockerfile -t $(DOCKER_TAG) .
|
||||
docker build --build-arg TARGETARCH=amd64 -f ./Dockerfile -t $(DOCKER_TAG) .
|
||||
|
||||
.PHONY: build-arm
|
||||
build-arm:
|
||||
|
@ -35,7 +35,7 @@ test-all: test-x86 test-arm
|
|||
|
||||
.PHONY: test-s3-x86
|
||||
test-s3-x86:
|
||||
cd tests && ./test-s3.sh
|
||||
cd tests && env TARGETARCH=amd64 ./test-s3.sh
|
||||
|
||||
.PHONY: shell-x86
|
||||
shell-x86: build-x86
|
||||
|
|
|
@ -31,10 +31,12 @@ Hostname is used for identifying what you are backing up. You may want to specif
|
|||
Mount all volumes from your existing container with `--volumes-from` and then back up by providing the paths to those volumes. If there are more than one volumes, you'll want to use the above tip for mulitple backup sources
|
||||
|
||||
### Restoring a backup
|
||||
On your running container, execute `/restore.sh`. That should be that! Eg. `docker exec my_backup_container /restore.sh`
|
||||
On your running container, execute `/scripts/restore.sh`. That should be that! Eg. `docker exec my_backup_container /scripts/restore.sh`
|
||||
|
||||
### Backup to any rclone destination
|
||||
This image also contains [rclone](https://rclone.org). This allows you to target any destination supported by rclone. Check out the [official documentation](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#other-services-via-rclone) to see how to configure this.
|
||||
|
||||
Rather than having to use an exec shell inside the container, I recommend configuring via the backup destination. For example: `rclone::ftp,env_auth:/test-restic` and then passing all config values via the environment.
|
||||
|
||||
### Pre/post backup/restore scripts
|
||||
Before and after any backup or restore, scripts located in `/scripts/{backup,restore}/{before,after}/` will be executed. This can be used to do things like snapshotting a database before backing it up and restoring the contents.
|
||||
|
|
|
@ -34,11 +34,11 @@ if [ -n "$CRON_SCHEDULE" ]; then
|
|||
echo "SHELL=/bin/bash" > /crontab.conf
|
||||
|
||||
# Schedule the backups
|
||||
echo "$CRON_SCHEDULE /cron-exec.sh /backup.sh" >> /crontab.conf
|
||||
echo "$CRON_SCHEDULE /scripts/cron-exec.sh /scripts/backup.sh" >> /crontab.conf
|
||||
echo "Backups scheduled as $CRON_SCHEDULE"
|
||||
|
||||
if [ -n "$VERIFY_CRON_SCHEDULE" ]; then
|
||||
echo "$VERIFY_CRON_SCHEDULE /cron-exec.sh /verify.sh" >> /crontab.conf
|
||||
echo "$VERIFY_CRON_SCHEDULE /scripts/cron-exec.sh /scripts/verify.sh" >> /crontab.conf
|
||||
echo "Verify scheduled as $VERIFY_CRON_SCHEDULE"
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
---
|
||||
version: '2'
|
||||
services:
|
||||
restic:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- TARGETARCH
|
||||
entrypoint: "bash"
|
||||
command: "-c 'sleep 2 && /test.sh'"
|
||||
hostname: itest
|
||||
|
|
Loading…
Reference in New Issue