From 4310787ace59658fb35f3b53b9da21daaf8345a8 Mon Sep 17 00:00:00 2001 From: Thomas Harvey Date: Sat, 25 Apr 2020 23:19:17 +0200 Subject: [PATCH 1/2] append VIPS_VERSION env var to layer name --- bin/deploy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/deploy b/bin/deploy index 5a506ab..920c8c1 100755 --- a/bin/deploy +++ b/bin/deploy @@ -4,7 +4,9 @@ set -e ./bin/build +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" From 88597943c8be7661d4275b414971c9cd5f3d9055 Mon Sep 17 00:00:00 2001 From: Thomas Harvey Date: Sun, 26 Apr 2020 00:19:07 +0200 Subject: [PATCH 2/2] Store the VIPS_VERSION to a file and use that as a reference when layer naming --- Dockerfile | 4 ++++ bin/build | 2 +- bin/deploy | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) 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 920c8c1..27cec61 100755 --- a/bin/deploy +++ b/bin/deploy @@ -4,6 +4,8 @@ set -e ./bin/build +. ./share/.env + LAYER_NAME="rubyvips${VIPS_VERSION//./}" aws lambda publish-layer-version \