-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (29 loc) · 935 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
# $Id$
.PHONY: clean all
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
CONTAINER_BASE_DIR := /tmp/func
CONTAINER_TAG=5.30
all: clean cpanfile
ifndef CONTAINER_TAG
@echo '[ERROR] $$CONTAINER_TAG must be specified'
@echo 'usage: make build CONTAINER_TAG=x.x'
exit 255
endif
docker run --rm \
-v $(ROOT_DIR):$(CONTAINER_BASE_DIR) \
-e TAG=$(CONTAINER_TAG) \
-e BASE_DIR=$(CONTAINER_BASE_DIR) \
moznion/lambda-perl-layer-foundation:$(CONTAINER_TAG) \
$(CONTAINER_BASE_DIR)/build.sh
mv func.zip ~/tmp
git status --porcelain | grep ^\? | awk '{print $$NF}' | xargs git add
-git commit -am "`git status --porcelain | awk '{print $$NF}' | awk -F/ '{print $$1}' | sort -u | xargs`"
git push
clean:
rm -rf \
local \
cpanfile \
cpanfile.snapshot \
func.zip
cpanfile:
cat *.pl | grep "^use [A-Z]" | awk '{print $$2}' | sed 's/;//' | sort -u | sed "s/^/requires '/;s/$$/', '0';/" > cpanfile