Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy does not fire rollback lifecycle event #101

Open
paries opened this issue Nov 30, 2020 · 0 comments
Open

deploy does not fire rollback lifecycle event #101

paries opened this issue Nov 30, 2020 · 0 comments

Comments

@paries
Copy link

paries commented Nov 30, 2020

(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",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant