diff --git a/Gemfile.lock b/Gemfile.lock index 1ef095c..aba6427 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - serverless-tools (0.4.0) + serverless-tools (0.4.1) aws-sdk-ecr aws-sdk-lambda aws-sdk-s3 diff --git a/lib/serverless-tools/deployer/python_builder.rb b/lib/serverless-tools/deployer/python_builder.rb index 7bb5157..25c927f 100644 --- a/lib/serverless-tools/deployer/python_builder.rb +++ b/lib/serverless-tools/deployer/python_builder.rb @@ -11,12 +11,13 @@ def build # Poetry does not have an option to install dependencies to a specified target folder. # Workaround is generating a requirments.txt file using poetry `poetry export -f requirements.txt --without-hashes > requirements.txt` - # And then installing them using pip to specified "package" target directory - `pip install -r requirements.txt -t ./package` - # Zipping contents of functions and package folders with the + # And then installing them using pip to specified "lambda-package" target directory + `pip install -r requirements.txt -t lambda-package` + # Zipping contents of functions and lambda-package folders with the # handler file in a zip as required by AWS - `zip -r "#{local_filename}" #{config.handler_file} src` - `cd package && zip -r "../#{local_filename}" ./*` + `zip -jr "#{local_filename}" #{config.handler_file}` + `zip -r "#{local_filename}" src` + `cd lambda-package && zip -r "../#{local_filename}" ./*` end def output diff --git a/lib/serverless-tools/version.rb b/lib/serverless-tools/version.rb index b2f72d8..d23ffb0 100644 --- a/lib/serverless-tools/version.rb +++ b/lib/serverless-tools/version.rb @@ -1,3 +1,3 @@ module ServerlessTools - VERSION = "0.4.0" + VERSION = "0.4.1" end diff --git a/pyproject.toml b/pyproject.toml index 4e2da65..1552e48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ # a python project file structure [tool.poetry] name = "serverless-tools" -version = "0.4.0" +version = "0.4.1" description = "FreeAgent Serverless Tools" authors = ["yasser.bennani@freeagent.com"] diff --git a/test/deployer/python_builder_test.rb b/test/deployer/python_builder_test.rb index 15d999d..d3a21e3 100644 --- a/test/deployer/python_builder_test.rb +++ b/test/deployer/python_builder_test.rb @@ -22,9 +22,9 @@ def assert_file_exists?(exists = true) File.delete(subject.local_filename) - # Delete package directory created by Python deployer build method + # Delete lambda-package directory created by Python deployer build method File.delete("requirements.txt") - FileUtils.remove_dir("./package",true) + FileUtils.remove_dir("./lambda-package",true) end describe "#local_filename" do