briareus
Version:
Briareus assists with Feature Branch deploys to ECS
26 lines (20 loc) • 655 B
JavaScript
const AWS = require('aws-sdk');
const _ = require('lodash');
let action = module.exports = function (pipeline, payload, cb) {
var ecs = new AWS.ECS();
// Return if we have no ECS Service
if (!payload.assets.ecsService || payload.assets.ecsService.destroyed) return cb(null, []);
var params = {
service: payload.name,
cluster: payload.ecsClusterArn
};
ecs.deleteService(params, (err, data) => {
if (err) return cb(err);
cb(null, [
{ op: 'add', path: '/assets/ecsService/destroyed', value: true },
]);
});
}
action.waiting = 'Destroying ECS Service';
action.done = 'ECS Service has been destroyed';