feat: initialize golang project template with docker and ci/cd
This commit is contained in:
24
Makefile
Normal file
24
Makefile
Normal file
@@ -0,0 +1,24 @@
|
||||
.PHONY: build run test lint clean docker-build
|
||||
|
||||
APP_NAME := app
|
||||
BUILD_DIR := build
|
||||
CMD_PATH := ./cmd/app
|
||||
|
||||
build:
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
go build -o $(BUILD_DIR)/$(APP_NAME) $(CMD_PATH)
|
||||
|
||||
run: build
|
||||
$(BUILD_DIR)/$(APP_NAME)
|
||||
|
||||
test:
|
||||
go test -v -race -cover ./...
|
||||
|
||||
lint:
|
||||
golangci-lint run
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
docker-build:
|
||||
docker build -t $(APP_NAME):latest .
|
||||
Reference in New Issue
Block a user