Skip to content

Commit

Permalink
patch: resolve host based on container id (hack)
Browse files Browse the repository at this point in the history
hacky approach of achieving erikengervall#79 (comment) (for testing purposes)
  • Loading branch information
n1ru4l committed Sep 24, 2019
1 parent 5b1a30a commit de5bbfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/onRun/waitForRunnersReadiness/checkConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ export { testables }

export default async (runner: Runner) => {
const {
runnerConfig: { service, connectionTimeout, host, ports },
runnerConfig: { service, connectionTimeout, ports },
logger,
} = runner

const host =
typeof runner.runnerConfig.host === 'function'
? runner.runnerConfig.host(runner.containerId)
: runner.runnerConfig.host

for (const port in ports) {
const recurse = async (connectionTimeout: number) => {
logger.debug(`Checking connection (${host}:${port}) (Timeout in: ${connectionTimeout}s)`)
Expand Down
2 changes: 1 addition & 1 deletion src/runners/@types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export interface SharedDefaultableConfigProps {
commands: string[]
connectionTimeout: number
dependsOn: DependsOn
host: string
host: string | ((containerId: string) => string)
image: string | undefined
networks: string[] | undefined
ports: ObjStrStr
Expand Down

0 comments on commit de5bbfe

Please sign in to comment.