Skip to content

deploy does not fire rollback lifecycle event #101

@paries

Description

@paries

(Thanks for reporting an issue! Please, then fill out the blanks below.)

What are the steps to reproduce this issue?

  1. create a deploy with alarms
  2. have the alarm fire
  3. 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",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions