Skip to content

Commit 5e8c66a

Browse files
author
GitHub Actions
committed
chore: Update dist
1 parent 70ceecd commit 5e8c66a

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

dist/index.js

+28-5
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ async function run() {
264264
const cluster = core.getInput('cluster', { required: false });
265265
const count = core.getInput('count', { required: true });
266266
const startedBy = core.getInput('started-by', { required: false }) || agent;
267+
const subnets = core.getInput('subnets', { required: true });
267268
const waitForFinish = core.getInput('wait-for-finish', { required: false }) || false;
268269
let waitForMinutes = parseInt(core.getInput('wait-for-minutes', { required: false })) || 30;
269270
if (waitForMinutes > MAX_WAIT_MINUTES) {
@@ -296,14 +297,36 @@ async function run() {
296297
cluster: clusterName,
297298
taskDefinition: taskDefArn,
298299
count: count,
299-
startedBy: startedBy
300+
startedBy: startedBy,
301+
networkConfiguration: {
302+
awsvpcConfiguration: {
303+
subnets: subnets
304+
},
305+
},
306+
})}`)
307+
308+
console.log(`Running task with ${JSON.stringify({
309+
cluster: clusterName,
310+
taskDefinition: taskDefArn,
311+
count: count,
312+
startedBy: startedBy,
313+
networkConfiguration: {
314+
awsvpcConfiguration: {
315+
subnets: subnets
316+
},
317+
},
300318
})}`)
301319

302320
const runTaskResponse = await ecs.runTask({
303321
cluster: clusterName,
304322
taskDefinition: taskDefArn,
305323
count: count,
306-
startedBy: startedBy
324+
startedBy: startedBy,
325+
networkConfiguration: {
326+
awsvpcConfiguration: {
327+
subnets: subnets
328+
},
329+
},
307330
}).promise();
308331

309332
core.debug(`Run task response ${JSON.stringify(runTaskResponse)}`)
@@ -336,7 +359,7 @@ async function waitForTasksStopped(ecs, clusterName, taskArns, waitForMinutes) {
336359
const maxAttempts = (waitForMinutes * 60) / WAIT_DEFAULT_DELAY_SEC;
337360

338361
core.debug('Waiting for tasks to stop');
339-
362+
340363
const waitTaskResponse = await ecs.waitFor('tasksStopped', {
341364
cluster: clusterName,
342365
tasks: taskArns,
@@ -347,7 +370,7 @@ async function waitForTasksStopped(ecs, clusterName, taskArns, waitForMinutes) {
347370
}).promise();
348371

349372
core.debug(`Run task response ${JSON.stringify(waitTaskResponse)}`)
350-
373+
351374
core.info(`All tasks have stopped. Watch progress in the Amazon ECS console: https://console.aws.amazon.com/ecs/home?region=${aws.config.region}#/clusters/${clusterName}/tasks`);
352375
}
353376

@@ -362,7 +385,7 @@ async function tasksExitCode(ecs, clusterName, taskArns) {
362385
const reasons = containers.map(container => container.reason)
363386

364387
const failuresIdx = [];
365-
388+
366389
exitCodes.filter((exitCode, index) => {
367390
if (exitCode !== 0) {
368391
failuresIdx.push(index)

0 commit comments

Comments
 (0)