serverless-plugin-canary-deployments
serverless-plugin-canary-deployments copied to clipboard
deploy does not fire rollback lifecycle event
(Thanks for reporting an issue! Please, then fill out the blanks below.)
What are the steps to reproduce this issue?
- create a deploy with alarms
- have the alarm fire
- When a rollback is executed because of the alarm no rollback event is fired
What happens?
When a rollback is executed because of the alarm no rollback event is fired
What were you expecting to happen?
would expect a rollback:initialize or rollback:rollback to fire when a rollback is started
Any logs, error output, etc?
https://pastebin.com/kfHg0V9g
Any other comments?
I am using a simple plugin to echo all the life cycle events
'use strict';
const _ = require('lodash');
class LifecyclePrinter {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
const service = this.serverless.service;
this.hooksToWatch = _.get(service, 'custom.lifeCycle.hooks');
this.debug = _.get(service, 'custom.lifeCycle.debug');
this.provider = this.serverless.getProvider('aws');
this.hooks = {};
for (let event in this.serverless.pluginManager.hooks) {
if (event.startsWith('before:') || event.startsWith('after:')) {
this.hooks[event] = this.hook.bind(this, event);
} else {
const beforeEvent = 'before:' + event;
this.hooks[beforeEvent] = this.hook.bind(this, beforeEvent);
const afterEvent = 'after:' + event;
this.hooks[afterEvent] = this.hook.bind(this, afterEvent);
}
}
}
hook(event) {
// eslint-disable-next-line no-console
console.log(' IN: %s', event);
}
}
module.exports = LifecyclePrinter;
I also tried all of these in the debug plugin
this.hooks = { 'after:webpack:package:packExternalModules': this.packExternalModules.bind(this), 'before:aws:deploy:deploy:updateStack': this.updateStack.bind(this), 'after:rollback:rollback': this.rollback.bind(this), 'before:rollback:rollback': this.rollback.bind(this), 'before:rollback:initialize': this.rollback.bind(this), 'after:rollback': this.rollback.bind(this), 'rollback': this.rollback.bind(this), 'aws:rollback:initialize': this.rollback.bind(this), 'aws:rollback': this.rollback.bind(this), 'before:aws:rollback': this.rollback.bind(this), 'before:aws:rollback:rollback': this.rollback.bind(this) };
None of these fired
thanks for your help
What versions of software are you using?
"serverless-plugin-canary-deployments": "^0.4.8",