Skip to content

Commit

Permalink
additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
aayushshah15 committed Sep 25, 2024
1 parent 2d18077 commit 242068a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ inputs:
nofallback:
description: "Fail the build if the remote builder is not available; defaults to false"
required: false
default: 'false'
add-hosts:
description: "List of a customs host-to-IP mapping (e.g., docker:10.180.0.1)"
required: false
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ async function getRemoteBuilderAddr(inputs: context.Inputs): Promise<string | nu
core.info(`Using dockerfile path: ${dockerfilePath}`);
}
core.info(`Anvil service: ${client.defaults.baseURL}`);
core.info(`Waiting for Blacksmith builder agent to be ready...`);
const response = await client.post('', payload);

const data = response.data;
Expand All @@ -90,11 +89,13 @@ async function getRemoteBuilderAddr(inputs: context.Inputs): Promise<string | nu
const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(2);
core.info(`Blacksmith builder agent ready after ${elapsedTime} seconds`);
return `tcp://${ec2Instance['instance_ip']}:4242` as string;
} else {
core.info(`Waiting...`);
}
await new Promise(resolve => setTimeout(resolve, 200));
}

await client.post(`/${stateHelper.blacksmithBuildTaskId}/abandon`);
await client.post(`/${taskId}/abandon`);
return null;
} catch (error) {
if (error.response && error.response.status === 404) {
Expand Down

0 comments on commit 242068a

Please sign in to comment.