-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 1.22 KB
/
Copy pathMakefile
File metadata and controls
41 lines (31 loc) · 1.22 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
BINARY := shellgate
BUILD_DIR := bin
GO := $(shell which go 2>/dev/null || echo /home/dxtz/go/bin/go)
GOFLAGS := -ldflags="-s -w"
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
.PHONY: build run dev clean test lint release
build:
$(GO) build $(GOFLAGS) -o $(BUILD_DIR)/$(BINARY) ./cmd/shellgate
run: build
./$(BUILD_DIR)/$(BINARY) serve
dev:
$(GO) run ./cmd/shellgate serve
clean:
rm -rf $(BUILD_DIR)
test:
$(GO) test ./...
lint:
golangci-lint run ./...
release:
GOOS=linux GOARCH=amd64 $(GO) build $(GOFLAGS) -o $(BUILD_DIR)/$(BINARY)_linux_amd64 ./cmd/shellgate
GOOS=linux GOARCH=arm64 $(GO) build $(GOFLAGS) -o $(BUILD_DIR)/$(BINARY)_linux_arm64 ./cmd/shellgate
GOOS=darwin GOARCH=amd64 $(GO) build $(GOFLAGS) -o $(BUILD_DIR)/$(BINARY)_darwin_amd64 ./cmd/shellgate
GOOS=darwin GOARCH=arm64 $(GO) build $(GOFLAGS) -o $(BUILD_DIR)/$(BINARY)_darwin_arm64 ./cmd/shellgate
GOOS=windows GOARCH=amd64 $(GO) build $(GOFLAGS) -o $(BUILD_DIR)/$(BINARY)_windows_amd64.exe ./cmd/shellgate
docker-build:
docker build -t shellgate:latest .
docker-run:
docker run -p 8080:8080 \
-e SHELLGATE_ADMIN_SECRET=your-secret \
-e SHELLGATE_KEYS_FILE=/app/data/keys.json \
shellgate:latest