Skip to content

Commit

Permalink
experiment with dir delte
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrinot committed Oct 12, 2023
1 parent a968d56 commit 3137d57
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,27 @@ public static void createContainer() {
@AfterAll
public static void stopContainer() {
questDBContainer.stop();
deleteFromContainer(questDBDirectory());
deleteFromContainer("questdb");
}

private static void deleteFromContainer(String directory) {
GenericContainer<?> cleanup = new GenericContainer<>("alpine:3.18.4")
.withCommand("rm -rf /var/lib/delete")
.withFileSystemBind(directory, "/var/lib/delete")
.withFileSystemBind(dbRoot.toAbsolutePath().toString(), "/var/lib/delete")
.withCommand("ls -l /var/lib/delete/")
.withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("cleanup")));
cleanup.start();
cleanup.stop();

cleanup = new GenericContainer<>("alpine:3.18.4")
.withFileSystemBind(dbRoot.toAbsolutePath().toString(), "/var/lib/delete")
.withCommand("rm -rf /var/lib/delete/" + directory)
.withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("cleanup")));
cleanup.start();
cleanup.stop();

cleanup = new GenericContainer<>("alpine:3.18.4")
.withFileSystemBind(dbRoot.toAbsolutePath().toString(), "/var/lib/delete")
.withCommand("ls -l /var/lib/delete/")
.withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("cleanup")));
cleanup.start();
cleanup.stop();
Expand Down

0 comments on commit 3137d57

Please sign in to comment.