-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
35 lines (23 loc) · 970 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
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_gs init $@
STACK_NAME ?= ghostscript-layer
result/bin/gs: all
build/output.yaml: template.yaml
aws cloudformation ${PROFILE} package --template $< --s3-bucket $(DEPLOYMENT_BUCKET) --output-template-file $@
deploy: build/output.yaml
aws cloudformation ${PROFILE} deploy --template $< --stack-name $(STACK_NAME)
aws cloudformation ${PROFILE} describe-stacks --stack-name $(STACK_NAME) --query Stacks[].Outputs --output table
publish:
sam publish -t build/output.yaml ${PROFILE}