Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into local-data-deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Milena-Czierlinski committed Dec 11, 2024
2 parents 5671fd3 + 697f11f commit 6772fbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ changelog:
- ci
- chore
- dependencies
- refactor
- refactoring
- test
categories:
- title: Breaking Changes
Expand Down
11 changes: 7 additions & 4 deletions packages/transport/test/testHelpers/TestUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,24 +656,27 @@ export class TestUtil {
}

public static async runDeletionJob(): Promise<void> {
const backboneVersion = this.getBackboneEnvVar("BACKBONE_VERSION");
const backboneVersion = this.getBackboneVersion();
const appsettingsOverrideLocation = process.env.APPSETTINGS_OVERRIDE_LOCATION ?? `${__dirname}/../../../../.dev/appsettings.override.json`;

await new GenericContainer(`ghcr.io/nmshd/backbone-identity-deletion-jobs:${backboneVersion}`)
.withWaitStrategy(Wait.forOneShotStartup())
.withCommand(["--Worker", "ActualDeletionWorker"])
.withNetworkMode("backbone")
.withCopyFilesToContainer([{ source: `${__dirname}/../../../../.dev/appsettings.override.json`, target: "/app/appsettings.override.json" }])
.withCopyFilesToContainer([{ source: appsettingsOverrideLocation, target: "/app/appsettings.override.json" }])
.start();
}

private static getBackboneEnvVar(name: string) {
private static getBackboneVersion() {
if (process.env.BACKBONE_VERSION) return process.env.BACKBONE_VERSION;

const envFile = fs.readFileSync(path.resolve(`${__dirname}/../../../../.dev/compose.backbone.env`));
const env = envFile
.toString()
.split("\n")
.map((line) => line.split("="))
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {} as Record<string, string>);

return env[name];
return env["BACKBONE_VERSION"];
}
}

0 comments on commit 6772fbe

Please sign in to comment.