File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -36,24 +36,23 @@ $ docker run --rm \
3636## Local Testing
3737
3838Once you've build a Rust lambda function artifact the ` provided ` runtime expects
39- deployments of that artifact to be named ** bootstrap**
39+ deployments of that artifact to be named ** bootstrap** . The lambda-rust docker image
40+ builds a zip file containing your binary files renamed to bootstrap
4041
41- ``` sh
42- $ mv target/lambda/release/{your-crate-name} target/lambda/release/bootstap
43- ```
44-
45- You can then invoke this bootstap executable with the lambda-ci provided docker image
42+ You can invoke this bootstap executable with the lambda-ci provided docker image
4643
4744
4845``` sh
4946# start a docker container replicating the "provided" lambda runtime
5047# awaiting an event to be provided via stdin
51- $ docker run \
52- -i -e DOCKER_LAMBDA_USE_STDIN=1 \
53- --rm \
54- -v \
55- " $PWD /target/lambda/release" :/var/task \
56- lambci/lambda:provided
48+ $ unzip \
49+ target/lambda/release/{your-binary-name}.zip \
50+ -d /tmp/lambda && \
51+ docker run \
52+ -i -e DOCKER_LAMBDA_USE_STDIN=1 \
53+ --rm \
54+ -v /tmp/lambda:/var/task \
55+ lambci/lambda:provided
5756
5857# provide payload via stdin (typically a json blob)
5958
Original file line number Diff line number Diff line change @@ -19,5 +19,11 @@ cd "$CARGO_TARGET_DIR"/release
1919 find -maxdepth 1 -executable -type f
2020 ) ; do
2121 strip " $file "
22+ rm " $file .zip" > 2& > /dev/null
23+ # note: would use printf "@ $(basename $file)\n@=bootstrap" | zipnote -w "$file.zip"
24+ # if not for https://bugs.launchpad.net/ubuntu/+source/zip/+bug/519611
25+ mv " $file " bootstrap
26+ zip " $file .zip" bootstrap
27+ rm bootstrap
2228 done
2329) 1>&2
You can’t perform that action at this time.
0 commit comments