@@ -55,20 +55,19 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes, enableECSMa
55
55
if(assignPublicIP != "" && (subnetIds != "" || securityGroupIds != "")){
56
56
awsvpcConfiguration["assignPublicIp"] = assignPublicIP
57
57
}
58
- let volumeConfigurations = []
59
- let volumeConfigurationJSON = {}
58
+ let volumeConfigurations;
59
+ let taskManagedEBSVolumeObject;
60
60
61
61
if (runTaskManagedEBSVolumeName != '') {
62
62
if (runTaskManagedEBSVolume != '{}') {
63
63
taskManagedEBSVolumeObject = convertToManagedEbsVolumeObject(runTaskManagedEbsVolume);
64
- volumeConfigurationJSON["name"] = runTaskManagedEbsVolumeName;
65
- volumeConfigurationJSON["managedEBSVolume"] = taskManagedEbsVolumeObject;
66
- volumeConfigurations.push(volumeConfigurationJSON);
64
+ volumeConfigurations = [{
65
+ name: runTaskManagedEBSVolumeName,
66
+ managedEBSVolume: taskManagedEBSVolumeObject
67
+ }];
67
68
} else {
68
69
core.warning(`run-task-managed-ebs-volume-name provided without run-task-managed-ebs-volume value. Ignoring run-task-managed-ebs-volume property`);
69
70
}
70
- } else {
71
- core.info(`No VolumeConfiguration Property provided for run-task-managed-ebs-volume`);
72
71
}
73
72
74
73
const runTaskResponse = await ecs.runTask({
@@ -199,40 +198,25 @@ async function tasksExitCode(ecs, clusterName, taskArns) {
199
198
200
199
// Deploy to a service that uses the 'ECS' deployment controller
201
200
async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForService, waitForMinutes, forceNewDeployment, desiredCount, enableECSManagedTags, propagateTags) {
202
- core.debug('Updating the provided ECS service');
201
+ core.debug('Updating the service');
203
202
204
203
const serviceManagedEbsVolumeName = core.getInput('service-managed-ebs-volume-name', { required: false }) || '';
205
- core.debug(`serviceManagedEbsVolume Name: ${serviceManagedEbsVolumeName}`);
206
- core.debug('serviceManagedEbsVolume Name.');
207
204
const serviceManagedEbsVolume = core.getInput('service-managed-ebs-volume', { required: false }) || '{}';
208
- core.debug(`serviceManagedEbsVolume Value: ${serviceManagedEbsVolume}`);
209
- core.debug('serviceManagedEbsVolume Value.');
210
-
211
- core.debug('Updating the service contd..');
212
205
213
206
let volumeConfigurations;
214
207
let serviceManagedEbsVolumeObject;
215
208
216
209
if (serviceManagedEbsVolumeName != '') {
217
- core.debug(`Assigning VolumeConfiguration Name: ${serviceManagedEbsVolumeName}`);
218
- core.debug('Assigning VolumeConfiguration.');
219
210
if (serviceManagedEbsVolume != '{}') {
220
211
serviceManagedEbsVolumeObject = convertToManagedEbsVolumeObject(serviceManagedEbsVolume);
221
- core.debug(`EBS Volume Object after conversion: ${JSON.stringify(serviceManagedEbsVolumeObject)}`);
222
-
223
212
volumeConfigurations = [{
224
213
name: serviceManagedEbsVolumeName,
225
214
managedEBSVolume: serviceManagedEbsVolumeObject // Note the exact casing here
226
215
}];
227
- core.debug('Assigning VolumeConfiguration Object');
228
216
} else {
229
217
core.warning('service-managed-ebs-volume-name provided without service-managed-ebs-volume value. Ignoring service-managed-ebs-volume property');
230
218
}
231
- } else {
232
- core.debug('No VolumeConfiguration Property provided for service-managed-ebs-volume');
233
219
}
234
- core.debug(`VolumeConfiguration Value: ${volumeConfigurations}`);
235
- core.debug('VolumeConfiguration Value Set.');
236
220
237
221
let params = {
238
222
cluster: clusterName,
@@ -244,10 +228,6 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
244
228
volumeConfigurations: volumeConfigurations
245
229
};
246
230
247
- core.debug(`Volume Configurations: ${JSON.stringify(volumeConfigurations, null, 2)}`);
248
- core.debug(`Managed EBS Volume Object: ${JSON.stringify(serviceManagedEbsVolumeObject, null, 2)}`);
249
- core.debug(`Final params: ${JSON.stringify(params, null, 2)}`);
250
-
251
231
// Add the desiredCount property only if it is defined and a number.
252
232
if (!isNaN(desiredCount) && desiredCount !== undefined) {
253
233
params.desiredCount = desiredCount;
@@ -346,9 +326,9 @@ function removeIgnoredAttributes(taskDef) {
346
326
for (var attribute of IGNORED_TASK_DEFINITION_ATTRIBUTES) {
347
327
if (taskDef[attribute]) {
348
328
core.warning(`Ignoring property '${attribute}' in the task definition file. ` +
349
- 'This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, ' +
350
- 'but it is not a valid field when registering a new task definition. ' +
351
- 'This field can be safely removed from your task definition file.');
329
+ 'This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, ' +
330
+ 'but it is not a valid field when registering a new task definition. ' +
331
+ 'This field can be safely removed from your task definition file.');
352
332
delete taskDef[attribute];
353
333
}
354
334
}
@@ -511,8 +491,8 @@ async function run() {
511
491
// Register the task definition
512
492
core.debug('Registering the task definition');
513
493
const taskDefPath = path.isAbsolute(taskDefinitionFile) ?
514
- taskDefinitionFile :
515
- path.join(process.env.GITHUB_WORKSPACE, taskDefinitionFile);
494
+ taskDefinitionFile :
495
+ path.join(process.env.GITHUB_WORKSPACE, taskDefinitionFile);
516
496
const fileContents = fs.readFileSync(taskDefPath, 'utf8');
517
497
const taskDefContents = maintainValidObjects(removeIgnoredAttributes(cleanNullKeys(yaml.parse(fileContents))));
518
498
let registerResponse;
@@ -581,7 +561,7 @@ module.exports = run;
581
561
582
562
/* istanbul ignore next */
583
563
if (require.main === require.cache[eval('__filename')]) {
584
- run();
564
+ run();
585
565
}
586
566
587
567
0 commit comments