Use the newly introduced LAMBDA_USE_LOCAL_DEPS environment variable inside Docker to allow to build Swift Lambda function using the local copy of the runtime
Motivation:
When developing and testing ideas on the Swift AWS Lambda Runtime, we often need to build code for deployment.
The local and CI build systems have been modified to allow to reference the local filesystem version of the library, instead of the remote one on Git. It uses the LAMBDA_USE_LOCAL_DEPS to make the difference. The examples' Package.swift have been updated by https://github.com/swift-server/swift-aws-lambda-runtime/pull/292
Modifications:
This PR, adds a check in the archiver plugin to mount ../.. in the docker container rather than . when building with local dependencies. This allows to refer to the local copy of the Swift AWS Lambda runtime library from within docker.
Result:
LAMBDA_USE_LOCAL_DEPS=true swift package archive --disable-sandbox
...
Build complete! (5.28s)
-------------------------------------------------------------------------
archiving "MyLambda"
-------------------------------------------------------------------------
1 archive created
* MyLambda at /Users/stormacq/<redacted>/swift-aws-lambda-runtime/Examples/Echo/.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/MyLambda/MyLambda.zip
Use the newly introduced
LAMBDA_USE_LOCAL_DEPS
environment variable inside Docker to allow to build Swift Lambda function using the local copy of the runtimeMotivation:
When developing and testing ideas on the Swift AWS Lambda Runtime, we often need to build code for deployment. The local and CI build systems have been modified to allow to reference the local filesystem version of the library, instead of the remote one on Git. It uses the
LAMBDA_USE_LOCAL_DEPS
to make the difference. The examples'Package.swift
have been updated by https://github.com/swift-server/swift-aws-lambda-runtime/pull/292Modifications:
This PR, adds a check in the archiver plugin to mount
../..
in the docker container rather than.
when building with local dependencies. This allows to refer to the local copy of the Swift AWS Lambda runtime library from within docker.Result: