Skip to content

Commit

Permalink
chore: #24 Move default configurations to constructor to allow for ov…
Browse files Browse the repository at this point in the history
…erride

Signed-off-by: Laurent Broudoux <[email protected]>
  • Loading branch information
lbroudoux committed Mar 28, 2024
1 parent 19521f4 commit 0e44b34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
17 changes: 8 additions & 9 deletions src/microcks-async-minion-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ export class MicrocksAsyncMinionContainer extends GenericContainer {
private network: StartedNetwork;
private extraProtocols: string = "";

constructor(network: StartedNetwork, image = "quay.io/microcks/microcks-uber-async-minion:1.8.1") {
constructor(network: StartedNetwork, image = "quay.io/microcks/microcks-uber-async-minion:1.9.0") {
super(image);
this.network = network;
this.withNetwork(this.network)
.withNetworkAliases("microcks-async-minion")
.withEnvironment({
MICROCKS_HOST_PORT: "microcks:" + MicrocksContainer.MICROCKS_HTTP_PORT
})
.withExposedPorts(MicrocksAsyncMinionContainer.MICROCKS_ASYNC_MINION_HTTP_PORT)
.withWaitStrategy(Wait.forLogMessage(/.*Profile prod activated\..*/, 1));
}

/**
Expand Down Expand Up @@ -85,14 +92,6 @@ export class MicrocksAsyncMinionContainer extends GenericContainer {
}

public override async start(): Promise<StartedMicrocksAsyncMinionContainer> {
this.withNetwork(this.network)
.withNetworkAliases("microcks-async-minion")
.withEnvironment({
MICROCKS_HOST_PORT: "microcks:" + MicrocksContainer.MICROCKS_HTTP_PORT
})
.withExposedPorts(...(this.hasExposedPorts ? this.exposedPorts : [MicrocksAsyncMinionContainer.MICROCKS_ASYNC_MINION_HTTP_PORT]))
.withWaitStrategy(Wait.forLogMessage(/.*Profile prod activated\..*/, 1));

return new StartedMicrocksAsyncMinionContainer(await super.start());
}

Expand Down
5 changes: 2 additions & 3 deletions src/microcks-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export class MicrocksContainer extends GenericContainer {

constructor(image = "quay.io/microcks/microcks-uber:1.9.0") {
super(image);
this.withExposedPorts(MicrocksContainer.MICROCKS_HTTP_PORT, MicrocksContainer.MICROCKS_GRPC_PORT)
.withWaitStrategy(Wait.forLogMessage(/.*Started MicrocksApplication.*/, 1));
}

/**
Expand Down Expand Up @@ -70,9 +72,6 @@ export class MicrocksContainer extends GenericContainer {
}

public override async start(): Promise<StartedMicrocksContainer> {
this.withExposedPorts(...(this.hasExposedPorts ? this.exposedPorts : [MicrocksContainer.MICROCKS_HTTP_PORT, MicrocksContainer.MICROCKS_GRPC_PORT]))
.withWaitStrategy(Wait.forLogMessage(/.*Started MicrocksApplication.*/, 1));

let startedContainer = new StartedMicrocksContainer(await super.start());
// Import artifacts declared in configuration.
for (let i=0; i<this.mainArtifacts.length; i++) {
Expand Down

0 comments on commit 0e44b34

Please sign in to comment.