ajmath / serverless-offline-scheduler

MIT License
96 stars 40 forks source link

Hotfix/add referencing cli options #32

Closed YifengZhong closed 4 years ago

YifengZhong commented 5 years ago

. Add options to load ${opt:some_option} if there are options. . Add null check for option --data.

ajmath commented 5 years ago

Thanks for the PR. Can you provide some more information on what you're trying to accomplish here? I've been away from the serverless ecosystem so I'm not quite sure what this.serverless.processedInput.options is used for.

YifengZhong commented 5 years ago

Thanks for the PR. Can you provide some more information on what you're trying to accomplish here? I've been away from the serverless ecosystem so I'm not quite sure what this.serverless.processedInput.options is used for.

Yes, I can. In our current project, we use sls offline start --owner $OWNER --aws_account $AWS_ACCOUNT --env $ENV ... to start local serverless server. The part --aws, --owner, --env,... are the options. When going into _executeFunction These options are save in this.serverless.processedInput.options as an object. this object is need to be extracted to options, then pass to serverless invoke local.

jayalfredprufrock commented 5 years ago

Would love to see this make it in. I think its fairly common to have required sls options in order to properly parse the serverless.yml file.

jimmythomson commented 4 years ago

I'd like to see this in too. I've tested it locally on a large project with several scheduled lambdas and it all seems to be working without issue.

ajmath commented 4 years ago

Sorry for not getting back to you sooner on this. This has been implemented in #40 and will be published to npm shortly. Thanks @YifengZhong for bringing this up and providing the POC