diff --git a/Dockerfile b/Dockerfile index 5e6b0a1..1b9159f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,3 +70,7 @@ RUN cd ./share/lib/ && \ # RUN cd ./share && \ zip --symlinks -r libvips.zip . + +# Store the VIPS_VERSION variable in a file, accessible to the deploy script. +# +RUN echo VIPS_VERSION=$VIPS_VERSION >> $WORKDIR/share/.env diff --git a/bin/build b/bin/build index df882b1..ab1d083 100755 --- a/bin/build +++ b/bin/build @@ -16,4 +16,4 @@ docker build \ docker run --rm \ -v "${PWD}/share:/share" \ $IMAGE_NAME \ - sh -c "cp /build/share/libvips.zip /share" + sh -c "cp /build/share/{libvips.zip,.env} /share" diff --git a/bin/deploy b/bin/deploy index 5a506ab..27cec61 100755 --- a/bin/deploy +++ b/bin/deploy @@ -4,7 +4,11 @@ set -e ./bin/build +. ./share/.env + +LAYER_NAME="rubyvips${VIPS_VERSION//./}" + aws lambda publish-layer-version \ - --layer-name "rubyvips891" \ + --layer-name $LAYER_NAME \ --description "Libvips for Ruby FFI." \ --zip-file "fileb://$(pwd)/share/libvips.zip"