Skip to content

Instantly share code, notes, and snippets.

@katzchang
Last active February 28, 2017 08:18
Show Gist options
  • Save katzchang/7e1a890eb9d0875d61148214d5519ad0 to your computer and use it in GitHub Desktop.
Save katzchang/7e1a890eb9d0875d61148214d5519ad0 to your computer and use it in GitHub Desktop.
HANDLERS = Hello \
my.LogAggregator \
my.CountDaily \
my.CountHourly \
supecial.LogCollector
BRANCH=$(shell git rev-parse --abbrev-ref @)
JAR=$(BRANCH)/myproject-assembly-0.1.jar
all:
@cat Makefile
echo $(GETS)
CREATES=$(HANDLERS:%=create/myproject.lambda.%)
$(CREATES): create
$(MAKE) -f lambda.mk create-function handler=$(@:create/%=%) S3Key=$(S3Key)
touch $@
create-all: $(CREATES)
UPDATES=$(HANDLERS:%=update/myproject.lambda.%)
$(UPDATES):
$(MAKE) -f lambda.mk update-function-code handler=$(@:update/%=%) S3Key=$(S3Key)
update-all: $(UPDATES)
GETS=$(HANDLERS:%=get/myproject.lambda.%)
$(GETS):
$(MAKE) -f lambda.mk get-function handler=$(@:get/%=%)
get-all: $(GETS)
clean:
rm -rf create/*
RETOUCHS=$(HANDLERS:%=retouch/myproject.lambda.%)
$(RETOUCHS): create
($(MAKE) -f lambda.mk get-function handler=$(@:retouch/%=%) \
&& touch create/$(@:retouch/%=%)) || \
echo "$(@:retouch/%=%) is not exists."
retouch-all: clean $(RETOUCHS)
create:
mkdir -p $@
API_KEY=
install:
curl -fsSL "https://mackerel.io/file/script/amznlinux/setup-yum.sh" | sh
yum install -y mackerel-agent
mackerel-agent init -apikey="$(API_KEY)"
start:
/sbin/service mackerel-agent start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment