Repository navigation
|
Is there a way to add commands to the ecs task commands created by EcsRunnerProvider? For debug and traceability I would like to make sure that the IP-address and if possible the job url is printed in the runner logs. |
Answered by
kichik
Aug 11, 2025
Replies: 1 comment 3 replies
|
Maybe something like this? const builder = EcsRunnerProvider.imageBuilder(stack, 'builder');
builder.addComponent(
RunnerImageComponent.environmentVariables({
ACTIONS_RUNNER_HOOK_JOB_STARTED: '/home/runner/runner-started.sh',
}),
);
builder.addComponent(
RunnerImageComponent.custom({
name: 'runner-started.sh',
commands: [
'echo "#!/bin/bash" > /home/runner/runner-started.sh',
'echo \'curl ${ECS_CONTAINER_METADATA_URI}/task) | jq -r ".Containers[0].Networks[0].IPv4Addresses[0]"\' >> /home/runner/runner-started.sh',
'echo \'echo https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\' >> /home/runner/runner-started.sh',
'chmod +x /home/runner/runner-started.sh',
],
}),
);
const provider = new EcsRunnerProvider(stack, 'ECS', {
labels: ['ecs'],
imageBuilder: builder,
}); |
3 replies
Answer selected by
kichik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe something like this?