diff --git a/Makefile b/Makefile index 8eb1cf7..394b12a 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,17 @@ STACK_NAME ?= ffmpeg-lambda-layer +DEPLOYMENT_PREFIX ?= "" -clean: +clean: rm -rf build -build/layer/bin/ffmpeg: +build/layer/bin/ffmpeg: mkdir -p build/layer/bin rm -rf build/ffmpeg* cd build && curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | tar x mv build/ffmpeg*/ffmpeg build/ffmpeg*/ffprobe build/layer/bin build/output.yaml: template.yaml build/layer/bin/ffmpeg - aws cloudformation package --template $< --s3-bucket $(DEPLOYMENT_BUCKET) --output-template-file $@ + aws cloudformation package --template $< --s3-bucket $(DEPLOYMENT_BUCKET) --s3-prefix $(DEPLOYMENT_PREFIX) --output-template-file $@ deploy: build/output.yaml aws cloudformation deploy --template $< --stack-name $(STACK_NAME) diff --git a/README.md b/README.md index 8a576d7..4689dad 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ Run the following command to deploy the compiled result as a layer in your AWS a make deploy DEPLOYMENT_BUCKET= ``` +You can optionally provide an S3 prefix, e.g.: + +``` +make deploy DEPLOYMENT_BUCKET= DEPLOYMENT_PREFIX= +``` + ### configuring the deployment By default, this uses `ffmpeg-lambda-layer` as the stack name. Provide a `STACK_NAME` variable when calling `make deploy` to use an alternative name.