This commit is contained in:
2022-10-20 10:36:29 +02:00
parent c37d824191
commit 79d9f55fdc
44 changed files with 130 additions and 371 deletions

View File

@@ -6,9 +6,9 @@ PREFIX?=$(shell pwd)
VERSION := 1.0
# Setup name variables for the package/tool
NAME := nos-comptes
BIN_NAME := noscomptes
PKG := github.com/kratisto/nos-comptes
NAME := budget
BIN_NAME := budgets
PKG := github.com/kratisto/budget
DOCKER_IMAGE_NAME := $(NAME)
# GO env vars
@@ -43,12 +43,11 @@ local-format: ## format locally all files
gofmt -s -l -w .
.PHONY: build
build: sources-image ## Build the docker image with application binary
build: ## Build the docker image with application binary
@echo "+ $@"
docker build --no-cache \
-f containers/Dockerfile \
--build-arg SOURCES_IMAGE=$(NAME)-sources:$(VERSION) \
-t poketools:$(VERSION) .
-f Dockerfile \
-t $(NAME):$(VERSION) .
GIT_CREDENTIALS?=$(shell cat ~/.git-credentials 2> /dev/null)
.PHONY: sources-image
@@ -78,7 +77,7 @@ local-launch-golang: ## Build the server and run it
kill $$PID || true
$(MAKE) $(BUILD_GOLANG_CMD)
DB_PORT=`docker-compose -p $(DOCKER_IMAGE_NAME)-uuid -f containers/docker-compose.local.yml port database 5432 | cut -f2 -d':'`; \
$(LAUNCH_GOLANG_CMD) serve --port 8081 --loglevel debug --logformat text --dbconnectionuri "postgresql://postgres:postgres@localhost:$$DB_PORT/nos_comptes?sslmode=disable"
$(LAUNCH_GOLANG_CMD) serve --port 8081 --loglevel debug --logformat text --dbconnectionuri "postgresql://postgres:postgres@localhost:$$DB_PORT/budget?sslmode=disable"
.PHONY: local-run
local-run: local-run-dependencies local-run-golang ## Run the server with its dependencies