-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
36 lines (24 loc) · 1000 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
DOCKER_IMAGE ?= lambci/lambda-base-2:build
TARGET ?=/opt/
MOUNTS = -v $(PROJECT_ROOT):/var/task \
-v $(PROJECT_ROOT)result:$(TARGET)
DOCKER = docker run -it --rm -w=/var/task/build
build result:
mkdir $@
clean:
rm -rf build result
bash:
$(DOCKER) $(MOUNTS) --entrypoint /bin/bash -t $(DOCKER_IMAGE)
all libs:
$(DOCKER) $(MOUNTS) --entrypoint /usr/bin/make -t $(DOCKER_IMAGE) TARGET_DIR=$(TARGET) -f ../Makefile_Rsvg init $@
STACK_NAME ?= rsvg-layer
result/bin/rsvg: all
build/output.yaml: template.yaml
aws cloudformation package --template $< --s3-bucket $(DEPLOYMENT_BUCKET) --output-template-file $@
deploy: build/output.yaml
aws cloudformation deploy --template $< --stack-name $(STACK_NAME)
aws cloudformation describe-stacks --stack-name $(STACK_NAME) --query Stacks[].Outputs --output table
deploy-example:
cd example && \
make deploy DEPLOYMENT_BUCKET=$(DEPLOYMENT_BUCKET) RSVG_STACK_NAME=$(STACK_NAME)