-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (39 loc) · 1.33 KB
/
Makefile
File metadata and controls
48 lines (39 loc) · 1.33 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
GO_LAMBDA_DIRS := authorizer jwt-issuer
.PHONY: all go kotlin clean build
all: go kotlin
go:
docker run --rm -v "$(PWD)":/app -w /app/golang public.ecr.aws/amazonlinux/amazonlinux:2 \
bash -c 'yum install -y golang zip && \
for dir in $(GO_LAMBDA_DIRS); do \
echo "Building $$dir..." && \
mkdir -p $$dir/build && \
GOOS=linux GOARCH=amd64 GOPROXY=https://proxy.golang.org,direct go build -buildvcs=false -o $$dir/build/bootstrap ./$$dir && \
(cd $$dir/build && zip function.zip bootstrap); \
done'
go-dev:
echo "Building golang (dev mode). Build in container if you'd like to deploy"
@for dir in $(GO_LAMBDA_DIRS); do \
echo "Building $$dir..."; \
cd golang && \
GOOS=linux GOARCH=amd64 GOPROXY=https://proxy.golang.org,direct go build -o $$dir/build/bootstrap ./$$dir && \
chmod +x $$dir/build/bootstrap && \
cd $$dir/build && \
zip function.zip bootstrap && \
cd ../../..; \
done
kotlin:
echo "Building gradle"
./gradlew build --parallel --no-daemon
kotlin-dev:
echo "Building gradle (dev mode)"
./gradlew build
openapi:
yq eval '.Resources.ZenobiaApi.Properties.DefinitionBody' sam/lambda-stack.yml | sed -E 's/!Sub //g' > openapi.yml
clean:
echo "Cleaning kotlin"
./gradlew clean
echo "Cleaning go"
@for dir in $(GO_LAMBDA_DIRS); do \
echo "Cleaning $$dir..."; \
rm -rf ./golang/$$dir/build; \
done