Skip to content

Commit a1f8ca4

Browse files
committed
use jq to get layer version
1 parent 1a708d9 commit a1f8ca4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.circleci/config.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
- *restore_repo
2222
- checkout
2323
- *save_repo
24+
- run: Install dependencies
25+
command: |
26+
pip install awscli
27+
sudo apt-get install jq
2428
- run:
2529
name: Build application Docker image
2630
command: |
@@ -41,13 +45,13 @@ jobs:
4145
docker run --rm -v $PWD:/home/geolambda --entrypoint package.sh -it developmentseed/geolambda:${VERSION}
4246
for region in us-east-1 us-west-2 eu-central-1
4347
do
44-
aws lambda publish-layer-version --region ${region} \
45-
--layer-name geolambda-dev --license-info "MIT" \
46-
--description "Native geospatial libaries for all runtimes" \
47-
--zip-file fileb://lambda-deploy.zip
48+
LVERSION='$(aws lambda publish-layer-version --region ${region} \
49+
--layer-name geolambda-dev --license-info 'MIT' \
50+
--description 'Native geospatial libaries for all runtimes' \
51+
--zip-file fileb://lambda-deploy.zip | jq '.Version')"
4852
aws lambda add-layer-version-permission --region ${region} \
4953
--layer-name geolambda-dev --action lambda:GetLayerVersion \
50-
--statement-id public --version-number 1 --principal '*'
54+
--statement-id public --version-number ${LVERSION} --principal '*'
5155
done
5256
5357

0 commit comments

Comments
 (0)