Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup both main and data #9

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
VERSION := $(shell yq e ".version" manifest.yaml)
S9PK_PATH=$(shell find . -name itchysats.s9pk -print)
TS_FILES := $(shell find . -name \*.ts )
ASSET_PATHS := $(shell find ./assets/*)

.DELETE_ON_ERROR:

Expand All @@ -16,7 +17,7 @@ clean:
rm -f image.tar
rm -f itchysats.s9pk

itchysats.s9pk: manifest.yaml image.tar instructions.md scripts/embassy.js
itchysats.s9pk: manifest.yaml image.tar instructions.md $(ASSET_PATHS) scripts/embassy.js
embassy-sdk pack

image.tar: Dockerfile health-check.sh docker_entrypoint.sh
Expand Down
3 changes: 3 additions & 0 deletions assets/compat/backup-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

compat duplicity create /mnt/backup /root/start9 && compat duplicity create /mnt/backup /data
3 changes: 3 additions & 0 deletions assets/compat/backup-restore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

compat duplicity restore /mnt/backup /root/start9 && compat duplicity restore /mnt/backup /data
20 changes: 8 additions & 12 deletions manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ volumes:
type: data
data:
type: data
compat:
type: assets
interfaces:
main:
name: ItchySats Interface
Expand Down Expand Up @@ -94,28 +96,22 @@ backup:
type: docker
image: compat
system: true
entrypoint: compat
args:
- duplicity
- create
- /mnt/backup
- /data
entrypoint: /mnt/assets/backup-create.sh
mounts:
BACKUP: /mnt/backup
main: /root/start9
data: /data
compat: /mnt/assets
restore:
type: docker
image: compat
system: true
entrypoint: compat
args:
- duplicity
- restore
- /mnt/backup
- /data
entrypoint: /mnt/assets/backup-restore.sh
mounts:
BACKUP: /mnt/backup
main: /root/start9
data: /data
compat: /mnt/assets
migrations:
from:
"*":
Expand Down