Skip to content

Commit

Permalink
fix snaphots x2
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansglazunov committed Sep 8, 2024
1 parent 1438435 commit d5f1c7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion snapshots/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const create = async () => {
const snapshots = files.filter(file => /^-?[0-9]+$/.test(file));
const last = snapshots[snapshots.length - 1];
const time = (new Date()).getTime();
const { stdout, stderr } = await execP(`(docker compose -f docker-compose.yml stop hasura postgres || true) && docker run -v ${_deeplinks}:/deeplinks --volumes-from deep-postgres --rm --name links --entrypoint \"sh\" deepf/deeplinks:main -c \"cd / && ls var/lib/postgresql && tar -c -v -C /var/lib/postgresql -f /deeplinks/snapshots/${time} ./data" && docker compose -f docker-compose.yml start hasura postgres && cp .migrate snapshots/${time}.migrate`);
const { stdout, stderr } = await execP(`(docker compose -f docker-compose.yml -p deep stop || true) && docker run -v ${_deeplinks}:/deeplinks --volumes-from deep-postgres --rm --name links --entrypoint \"sh\" deepf/deeplinks:main -c \"cd / && ls var/lib/postgresql && tar -c -v -C /var/lib/postgresql -f /deeplinks/snapshots/${time} ./data" && docker compose -f docker-compose.yml -p deep start -d && cp .migrate snapshots/${time}.migrate`);
console.log('stdout',stdout);
console.log('stderr',stderr);
}
Expand Down
2 changes: 1 addition & 1 deletion snapshots/last.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const last = async () => {
const files = await fs.readdir('./snapshots');
const snapshots = files.filter(file => /^-?[0-9]+$/.test(file));
const last = snapshots[snapshots.length - 1];
const { stdout, stderr } = await execP(`(docker compose -p deep -f docker-compose.yml stop hasura postgres || true ) && docker run -v ${_deeplinks}:/deeplinks -v deep-db-data:/data --rm --name links --entrypoint \"sh\" deepf/deeplinks:main -c \"cd / && tar xf deeplinks/snapshots/${last} --strip 1\" && (docker compose -p deep up -d hasura postgres || true) && cp snapshots/${last}.migrate .migrate`);
const { stdout, stderr } = await execP(`(docker compose -p deep -f docker-compose.yml -p deep stop || true ) && docker run -v ${_deeplinks}:/deeplinks -v deep-db-data:/data --rm --name links --entrypoint \"sh\" deepf/deeplinks:main -c \"cd / && tar xf deeplinks/snapshots/${last} --strip 1\" && (docker compose -p deep up -d || true) && cp snapshots/${last}.migrate .migrate`);
console.log('stdout',stdout);
console.log('stderr',stderr);
}
Expand Down

0 comments on commit d5f1c7d

Please sign in to comment.