Skip to content

Commit

Permalink
add run-test target
Browse files Browse the repository at this point in the history
  • Loading branch information
krustowski committed Jul 8, 2024
1 parent d85b5fa commit 7694624
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ GOOS := $(shell go env GOOS)

# docker environment
DOCKER_COMPOSE_FILE?=deployments/docker-compose.yml
DOCKER_COMPOSE_TEST_FILE?=deployments/docker-compose-test.yml
DOCKER_COMPOSE_OVERRIDE?=deployments/docker-compose.override.yml
DOCKER_COMPOSE_TEST_OVERRIDE?=deployments/docker-compose-test.override.yml
DOCKER_CONTAINER_NAME?=${PROJECT_NAME}-server
DOCKER_IMAGE_TAG?=${REGISTRY}backend:${APP_VERSION}-go${GOLANG_VERSION}
DOCKER_INTERNAL_PORT?=8080
Expand Down Expand Up @@ -143,6 +145,14 @@ run:
&& 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

.PHONY: run-test
run-test:
@echo -e "\n${YELLOW} Starting test project (docker compose up)... ${RESET}\n"
@[ -f ".env" ] || cp .env.example .env
@[ -f ${DOCKER_COMPOSE_TEST_OVERRIDE} ] \
&& docker compose -f ${DOCKER_COMPOSE_TEST_FILE} -f ${DOCKER_COMPOSE_TEST_OVERRIDE} up --force-recreate --detach --remove-orphans \
|| docker compose -f ${DOCKER_COMPOSE_TEST_FILE} up --force-recreate --detach --remove-orphans

.PHONY: logs
logs:
@echo -e "\n${YELLOW} Fetching container's logs (CTRL-C to exit)... ${RESET}\n"
Expand Down

0 comments on commit 7694624

Please sign in to comment.