lifadev / archive_aws-lambda-go-shim

Author your AWS Lambda functions in Go, effectively.
https://github.com/eawsy/aws-lambda-go-shim
Apache License 2.0
789 stars 66 forks source link

pack one or more config file, library in package #21

Closed sandangel closed 7 years ago

sandangel commented 7 years ago

In Makefile you can use something like this: pack: @pack $(HANDLER) $(HANDLER).so dist $(PACKAGE).zip

fsenart commented 7 years ago

Hi @sandangel, First, thank you very much for taking the time to contribute to the project. The pack script was primary written to ensure that the handler.so is correctly zipped, with adequate shim name, binary name and that the zip hash won't change if your handler.so isn't changed. Here are the only purposes of the pack script. As such I really want to restrict its use to the scope of the shim internal weirdness and not make it some kind of general purpose packaging script. This is also why we provide a fully customizable Makefile so the end-user can enhance the packaging process if needed. Also, one can achieve the same set of possibilities than your modification by appending a line in the Makefile pack target and by using vanilla zip without relying on the pack script:

pack:
    @pack $(HANDLER) $(HANDLER).so $(PACKAGE).zip
    @zip -ru $(PACKAGE).zip any_file_or_folder

The matter of fact is that, this project will be replaced somewhere in the future by an official product from AWS Lambda team. And we want users to have a very seamless migration path without any kind of dependency on this project's internals.

sandangel commented 7 years ago

oh i see. thanks for the zip cmd, it solves my problem without build my own image.