Added Docker container and compose definitions to make development easier
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -1,45 +1,24 @@
|
||||
NAME=blt
|
||||
VERSION=`git describe --tags`
|
||||
|
||||
.PHONY: build
|
||||
## build: Compile the packages.
|
||||
# used for changing the output directory within docker containers
|
||||
BUILD_DIR ?= .
|
||||
|
||||
dev-up:
|
||||
docker compose -f docker-dev.yml up -d
|
||||
|
||||
dev-down:
|
||||
docker compose -f docker-dev.yml down
|
||||
|
||||
dev-build:
|
||||
docker compose -f docker-dev.yml build
|
||||
|
||||
build:
|
||||
@go build -o $(NAME) -ldflags "-X git.metaunix.net/bitgoblin/blt/app.AppVersion=$(VERSION)"
|
||||
@echo "Building Go binary..."
|
||||
@go build -o $(BUILD_DIR)/$(NAME) -ldflags "-X git.metaunix.net/bitgoblin/blt/app.AppVersion=$(VERSION)"
|
||||
|
||||
.PHONY: grunt
|
||||
## grunt: Compile frontend assets.
|
||||
grunt:
|
||||
@npm run grunt
|
||||
|
||||
.PHONY: grunt-watch
|
||||
## grunt-watch: Compile frontend assets while watching for changes.
|
||||
grunt-watch:
|
||||
@npm run grunt watch
|
||||
|
||||
.PHONY: run
|
||||
## run: Build and Run in development mode.
|
||||
run: build
|
||||
@./$(NAME) -e development
|
||||
|
||||
.PHONY: run-prod
|
||||
## run-prod: Build and Run in production mode.
|
||||
run-prod: build
|
||||
@./$(NAME) -e production
|
||||
|
||||
.PHONY: clean
|
||||
## clean: Clean project and previous builds.
|
||||
clean:
|
||||
@rm -f $(NAME)
|
||||
|
||||
.PHONY: deps
|
||||
## deps: Download modules
|
||||
deps:
|
||||
@go mod download
|
||||
|
||||
.PHONY: test
|
||||
## test: Run tests with verbose mode
|
||||
test:
|
||||
@go test -v ./tests/*
|
||||
run:
|
||||
$(BUILD_DIR)/$(NAME)
|
||||
|
||||
.PHONY: help
|
||||
all: help
|
||||
|
||||
Reference in New Issue
Block a user