File tree Expand file tree Collapse file tree 5 files changed +66
-1
lines changed
Expand file tree Collapse file tree 5 files changed +66
-1
lines changed Original file line number Diff line number Diff line change 11ROOT_DIR: =$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST ) ) ) )
22
33php71.zip :
4- echo $(ROOT_DIR )
54 docker run --rm -v $(ROOT_DIR ) :/opt/layer lambci/lambda:build-nodejs8.10 /opt/layer/build.sh
65
6+ upload : php71.zip
7+ ./upload.sh
8+
9+ publish : php71.zip
10+ ./publish.sh
11+
712clean :
813 rm php71.zip
Original file line number Diff line number Diff line change 1+ #! /bin/bash -e
2+
3+ source regions.sh
4+
5+ for region in " ${PHP71_REGIONS[@]} " ; do
6+ bucket_name=" stackery-layers-${region} "
7+
8+ echo " Creating bucket ${bucket_name} ..."
9+
10+ aws s3 mb s3://$bucket_name --region $region
11+ done
Original file line number Diff line number Diff line change 1+ #! /bin/bash -e
2+
3+ source regions.sh
4+
5+ MD5SUM=$( md5 -q php71.zip)
6+ S3KEY=" php71/${MD5SUM} "
7+
8+ for region in " ${PHP71_REGIONS[@]} " ; do
9+ bucket_name=" stackery-layers-${region} "
10+
11+ echo " Publishing Lambda Layer php71 in region ${region} ..."
12+ version=$( aws --region $region lambda publish-layer-version --layer-name php71 --compatible-runtimes provided --content " S3Bucket=$bucket_name ,S3Key=${S3KEY} " --output text --query Version)
13+ echo " Published Lambda Layer php71 in region ${region} version ${version} "
14+
15+ echo " Setting public permissions on Lambda Layer php71 version ${version} in region ${region} ..."
16+ aws --region $region lambda add-layer-version-permission --layer-name php71 --version-number $version --statement-id=public --action lambda:GetLayerVersion --principal ' *' > /dev/null
17+ echo " Public permissions set on Lambda Layer php71 version ${version} in region ${region} "
18+ done
Original file line number Diff line number Diff line change 1+ PHP71_REGIONS=(
2+ ap-northeast-1
3+ ap-northeast-2
4+ ap-south-1
5+ ap-southeast-1
6+ ap-southeast-2
7+ ca-central-1
8+ eu-central-1
9+ eu-west-1
10+ eu-west-2
11+ eu-west-3
12+ sa-east-1
13+ us-east-1
14+ us-east-2
15+ us-west-1
16+ us-west-2
17+ )
Original file line number Diff line number Diff line change 1+ #! /bin/bash -e
2+
3+ source regions.sh
4+
5+ MD5SUM=$( md5 -q php71.zip)
6+ S3KEY=" php71/${MD5SUM} "
7+
8+ for region in " ${PHP71_REGIONS[@]} " ; do
9+ bucket_name=" stackery-layers-${region} "
10+
11+ echo " Uploading php71.zip to s3://${bucket_name} /${S3KEY} "
12+
13+ aws --region $region s3 cp php71.zip " s3://${bucket_name} /${S3KEY} "
14+ done
You can’t perform that action at this time.
0 commit comments