init repository
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
.DEFAULT_GOAL := run
|
||||
|
||||
BIN_NAME := localenv
|
||||
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
BUILD_DIR := $(ROOT_DIR)builds
|
||||
|
||||
build: format lint
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
@go build -o $(BUILD_DIR)/$(BIN_NAME) main.go
|
||||
|
||||
format:
|
||||
go fmt ./...
|
||||
|
||||
lint:
|
||||
golangci-lint run --fix
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
start: build
|
||||
@mkdir -p /tmp/localenv-swarm
|
||||
@$(BUILD_DIR)/$(BIN_NAME)
|
||||
|
||||
start-watch: build
|
||||
@mkdir -p /tmp/localenv-swarm
|
||||
@$(BUILD_DIR)/$(BIN_NAME) --watch
|
||||
|
||||
stop:
|
||||
docker stop localenv-swarm
|
||||
|
||||
purge:
|
||||
docker rm -fv localenv-swarm
|
||||
|
||||
enter:
|
||||
docker exec -it localenv-swarm /bin/bash
|
||||
|
||||
docker-swarm:
|
||||
docker build . -t localenv-swarm:latest -f swarm/Dockerfile
|
||||
|
||||
docker-nginx:
|
||||
@cd nginx/ssl && ./generate-certs.bash
|
||||
docker build . -t localenv-nginx:latest -f nginx/Dockerfile
|
||||
Reference in New Issue
Block a user