-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 957 Bytes
/
Makefile
File metadata and controls
34 lines (26 loc) · 957 Bytes
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
# Needs to be deployed to a linux environment
GOOS=linux
GOARCH=amd64
# Compile a static binary for better compatibility
CGO_ENABLED=0
LD_FLAGS='-extldflags "-static"'
all: build/azure_functions.zip
build/azure_functions.zip: AzureFunctions/handler
# Create directory for build
mkdir -p build
cd AzureFunctions && zip -r ../build/azure_functions.zip *
# Display size of output zip
@ls -lh build/azure_functions.zip | awk '{print $$5 " " $$9}'
AzureFunctions/handler: cmd/api/main.go
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags $(LD_FLAGS) -o $@ $<
clean:
rm AzureFunctions/handler
rm build/*
dev:
# Install air if not already present
# https://github.com/cosmtrek/air
command -v air > /dev/null || curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(GOPATH)/bin
# Start local docker containers for development
docker-compose up -d
# Start development server
air