-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
37 lines (26 loc) · 1.13 KB
/
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
36
37
BINDIR = ./bin
EXECUTABLE = justdeploy
GIT_TAG = $(shell git describe --tags --abbrev=0)
LDFLAGS = -ldflags "-X cchalop1.com/deploy/internal/application.Version=$(GIT_TAG)"
all: build-web copy-web-build build-go
build-ci: build-web copy-web-build build-darwin-arm build-darwin-x86 build-linux-arm build-linux-x86
build-darwin-arm:
@env GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(BINDIR)/$(EXECUTABLE)-darwin-arm ./cmd/just-deploy/main.go
build-darwin-x86:
@env GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(BINDIR)/$(EXECUTABLE)-darwin-x86 ./cmd/just-deploy/main.go
build-linux-arm:
@env GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(BINDIR)/$(EXECUTABLE)-linux-arm ./cmd/just-deploy/main.go
build-linux-x86:
@env GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BINDIR)/$(EXECUTABLE)-linux-x86 ./cmd/just-deploy/main.go
build-go:
@go build $(LDFLAGS) -o $(BINDIR)/$(EXECUTABLE) ./cmd/just-deploy/main.go
build-web:
@cd web && bun install && bun run build
copy-web-build:
cp -R web/dist internal/web/dist/
run:
@$(BINDIR)/$(EXECUTABLE)
clean:
@rm -rf $(BINDIR)
@cd web && rm -rf dist
@rm -r internal/web/dist