#!/bin/bash -e
if [[ ! -f /build_cache/${DEPENDENCIES_SHA}.zip ]] || [[ "$REBUILD_DEPENDENCIES" == "1" ]]; then
    echo "rebuilding dependencies"
    rm -rf /build_cache/*
    mkdir /tmp/build
    /usr/bin/pip-${python_version:6:1}.${python_version:7:1} install -r /requirements.txt -t /tmp/build
    cd /tmp/build
    zip -r /build_cache/${DEPENDENCIES_SHA}.zip ./*
else
    echo "using cached dependencies; no rebuild"
fi
cd /src
rm -f /dist/lambda_function.zip
cp /build_cache/${DEPENDENCIES_SHA}.zip /dist/lambda_function.zip
zip -r /dist/lambda_function.zip .
cd /tmp
echo "{\"VERSION_HASH\": \"${VERSION_HASH}\", \"BUILD_TIME\": \"${BUILD_TIME}\"}" > config.json
zip -r /dist/lambda_function.zip config.json

#!/bin/bash -e
if [[ ! -f /build_cache/${DEPENDENCIES_SHA}.zip ]] || [[ "$REBUILD_DEPENDENCIES" == "1" ]]; then
    echo "rebuilding dependencies"
    rm -rf /build_cache/*
    mkdir /tmp/build
    /usr/bin/pip-${python_version:6:1}.${python_version:7:1} install -r /requirements.txt -t /tmp/build
    cd /tmp/build
    zip -r /build_cache/${DEPENDENCIES_SHA}.zip .
else
    echo "using cached dependencies; no rebuild"
fi
cd /src
rm -f /dist/lambda_function.zip
cp /build_cache/${DEPENDENCIES_SHA}.zip /dist/lambda_function.zip
zip -r /dist/lambda_function.zip .
cd /tmp
echo "{\"VERSION_HASH\": \"${VERSION_HASH}\", \"BUILD_TIME\": \"${BUILD_TIME}\"}" > config.json
zip -r /dist/lambda_function.zip config.json

Change the zip parameters to allow dot files
Change the zip parameters to allow dot files

The previous parameters dropped dofiles and directories starting with a
dot. This caused packaging of certain dependencies, namely cryptography
, to break. I've tested this fix on a project exhibiting the issue and
this has confirmed to have solved the problem. Thanks @ryandub for the
suggestion.
