Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use a separate make target for production up to not create dependencies #10480

Merged
merged 5 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/container-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ jobs:
cd ${{ matrix.env }} && \
make hdown && \
make build_lang && \
make up
make prod_up

- name: Check services are up
uses: appleboy/ssh-action@master
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ TEST_CMD ?= yath test -PProductOpener::LoadData

# Space delimited list of dependant projects
DEPS=openfoodfacts-shared-services
ifndef DEPS_DIR
# Set the DEPS_DIR if it hasn't been set already
ifeq (${DEPS_DIR},)
export DEPS_DIR=${PWD}/deps
endif

Expand All @@ -74,6 +75,7 @@ _FORCE:
# Info #
#------#
info:
@echo ${DEPS_DIR}
@echo "${NAME} version: ${VERSION}"

usage:
Expand Down Expand Up @@ -134,6 +136,11 @@ _up:run_deps

up: build create_folders _up

# Used by staging so that shared services are not created
prod_up: build create_folders
@echo "🥫 Starting containers …"
${DOCKER_COMPOSE} up -d 2>&1

down:
@echo "🥫 Bringing down containers …"
${DOCKER_COMPOSE} down
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-livecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ENV_FILE="${ENV_FILE:-.env}"
RET_CODE=0
for service in `docker compose --env-file=${ENV_FILE} config --service | tr '\n' ' '`; do
for service in `docker compose --env-file=${ENV_FILE} config --services | tr '\n' ' '`; do
if [ -z `docker compose ps -q $service` ] || [ -z `docker ps -q --no-trunc | grep $(docker compose --env-file=${ENV_FILE} ps -q $service)` ]; then
echo "$service: DOWN"
RET_CODE=1
Expand Down
Loading