Skip to content

fix(snaplet): add snaplet target DB var to SNAPSHOT_PATHs #25

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

Merged
merged 3 commits into from
Jun 4, 2025
Merged
Changes from 1 commit
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
9 changes: 5 additions & 4 deletions lib/snaplet/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ tasks:
- task: validate-snaplet-bucket-access
vars:
RESTORE_SNAPSHOT: '{{.RESTORE_SNAPSHOT | default "latest"}}'
SNAPSHOT_PATH: ".snaplet/snapshots/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT}}"
SNAPSHOT_PATH: ".snaplet/snapshots/{{.SNAPLET_TARGET_DB_NAME}}/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT}}"
requires:
vars:
- SNAPLET_BUCKET
- SNAPSHOT_ENV
- SNAPLET_TARGET_DB_NAME
cmds:
- aws s3 cp --quiet --sse=AES256 --recursive {{.SNAPLET_BUCKET}}/{{SNAPLET_TARGET_DB_NAME}}/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT}} {{.SNAPSHOT_PATH}}
- aws s3 cp --quiet --sse=AES256 --recursive {{.SNAPLET_BUCKET}}/{{.SNAPLET_TARGET_DB_NAME}}/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT}} {{.SNAPSHOT_PATH}}
- printf "\n\n⬇ Snapshot downloaded to {{.SNAPSHOT_PATH}}\n\n"

restore:
Expand All @@ -127,9 +127,10 @@ tasks:
vars:
RESTORE_OPTIONS: '{{.RESTORE_OPTIONS | default ""}}'
RESTORE_SNAPSHOT: '{{.RESTORE_SNAPSHOT | default "latest"}}'
SNAPSHOT_PATH: .snaplet/snapshots/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT}}
SNAPSHOT_PATH: .snaplet/snapshots/{{.SNAPLET_TARGET_DB_NAME}}/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT}}
requires:
vars:
- SNAPLET_TARGET_DB_NAME
- SNAPLET_TARGET_DATABASE_URL
cmds:
- printf "\n\n👋 Restoring snapshot from {{.SNAPSHOT_PATH}}\n"
Expand All @@ -141,7 +142,7 @@ tasks:
silent: true
vars:
RESTORE_SNAPSHOT: '{{.RESTORE_SNAPSHOT | default "latest"}}'
SNAPSHOT_PATH: .snaplet/snapshots/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT}}
SNAPSHOT_PATH: .snaplet/snapshots/{{.SNAPLET_TARGET_DB_NAME}}/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT}}
requires:
vars:
- SNAPLET_TARGET_DATABASE_URL
Expand Down