feat(devops): tried to fix ci

This commit is contained in:
Maieul BOYER 2026-01-14 14:10:39 +01:00 committed by Maix0
parent d0e787e2c7
commit ac2e3669ca
4 changed files with 48 additions and 15 deletions

View file

@ -1,16 +1,46 @@
.PHONY: logs
# Set DEV only if it is not already set and .dev file exists
IS_CI=n
IS_DEV=n
REDUCED_SET=n
DOCKER_SERVICE=
ifndef DEV
ifeq "$(wildcard .dev)" ".dev"
IS_DEV := y
REDUCED_SET := y
endif
endif
ifeq "$(DEV)" "y"
IS_DEV := y
REDUCED_SET := y
endif
ifeq "$(CI)" "y"
IS_CI := y
REDUCED_SET := y
endif
# TODO: REMOVE THIS BEFORE LAUNCH
# this allows the us to only start the non-monitoring sercices
#DOCKER_SERVICE= \
# auth \
# chat \
# tic-tac-toe \
# nginx \
# user \
# pong \
ifeq "$(REDUCED_SET)" "y"
DOCKER_SERVICE := \
auth \
chat \
tic-tac-toe \
nginx \
user \
pong
endif
all: build
@[ $(REDUCED_SET) = y ] && echo -e "\x1b[31mUSING REDUCED SET OF DOCKER CONTAINER\x1b[0m" || true
@[ $(IS_DEV) = y ] && echo -e "\x1b[31mUsing dev mode => remove .dev if needed\x1b[0m" || true
@[ $(IS_CI) = y ] && echo -e "\x1b[31mUsing CI mode => Check env if needed\x1b[0m" || true
docker compose up -d $(DOCKER_SERVICE)
logs:
@ -20,6 +50,9 @@ down:
docker compose down
build: .env
@[ $(REDUCED_SET) = y ] && echo -e "\x1b[31mUSING REDUCED SET OF DOCKER CONTAINER\x1b[0m" || true
@[ $(IS_DEV) = y ] && echo -e "\x1b[31mUsing dev mode => remove .dev if needed\x1b[0m" || true
@[ $(IS_CI) = y ] && echo -e "\x1b[31mUsing CI mode => Check env if needed\x1b[0m" || true
docker compose build $(DOCKER_SERVICE)
re: