Skip to content

Commit

Permalink
fix missing .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
krustowski committed Jul 8, 2024
1 parent d35ad4d commit ef0bab1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
include .env.example
-include .env



APP_NAME=litter-go
APP_URLS_TRAEFIK?=`${HOSTNAME}`
PROJECT_NAME=${APP_NAME}
Expand Down Expand Up @@ -120,7 +118,7 @@ config:
@go install github.com/swaggo/swag/cmd/swag@latest

.PHONY: docs
docs:
docs: config
@echo -e "\n${YELLOW} Generating OpenAPI documentation... ${RESET}\n"
@~/go/bin/swag init --parseDependency -ot json -g router.go --dir pkg/backend/
@mv docs/swagger.json api/swagger.json
Expand All @@ -131,13 +129,15 @@ docs:
.PHONY: build
build:
@echo -e "\n${YELLOW} Building the project (docker compose build)... ${RESET}\n"
@[ -f ".env" ] || cp .env.example .env
@[ -f ${DOCKER_COMPOSE_OVERRIDE} ] \
&& DOCKER_BUILDKIT=1 docker compose -f ${DOCKER_COMPOSE_FILE} -f ${DOCKER_COMPOSE_OVERRIDE} build \
|| DOCKER_BUILDKIT=1 docker compose -f ${DOCKER_COMPOSE_FILE} build

.PHONY: run
run:
@echo -e "\n${YELLOW} Starting project (docker compose up)... ${RESET}\n"
@[ -f ".env" ] || cp .env.example .env
@[ -f ${DOCKER_COMPOSE_OVERRIDE} ] \
&& docker compose -f ${DOCKER_COMPOSE_FILE} -f ${DOCKER_COMPOSE_OVERRIDE} up --force-recreate --detach --remove-orphans \
|| docker compose -f ${DOCKER_COMPOSE_FILE} up --force-recreate --detach --remove-orphans
Expand All @@ -150,6 +150,7 @@ logs:
.PHONY: stop
stop:
@echo -e "\n${YELLOW} Stopping and purging project (docker compose down)... ${RESET}\n"
@[ -f ".env" ] || cp .env.example .env
@docker compose -f ${DOCKER_COMPOSE_FILE} down

.PHONY: version
Expand Down Expand Up @@ -180,6 +181,7 @@ push:
.PHONY: sh
sh:
@echo -e "\n${YELLOW} Attaching container's (${DOCKER_CONTAINER_NAME})... ${RESET}\n"
@[ -f ".env" ] || cp .env.example .env
@docker exec -it ${DOCKER_CONTAINER_NAME} sh

.PHONY: flush
Expand All @@ -194,6 +196,7 @@ flush:
.PHONY: kill
kill:
@echo -e "\n${YELLOW} Killing the container not to dump running caches... ${RESET}\n"
@[ -f ".env" ] || cp .env.example .env
@docker kill ${DOCKER_CONTAINER_NAME}

RUN_DATA_DIR=./.run_data
Expand Down

0 comments on commit ef0bab1

Please sign in to comment.