From f9e1cda2fb72e202fc19d5cb231a0ae842c84604 Mon Sep 17 00:00:00 2001 From: Frugan Date: Mon, 17 Jun 2024 23:04:45 +0200 Subject: [PATCH] build: attempt to use {WORDPRESS,NODE}_CONTAINER_HOST --- .github/workflows/ci.yml | 9 +++++++-- Makefile | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f894a7..e73aa06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true @@ -47,5 +47,10 @@ jobs: - name: Run Makefile tasks run: | - make test MARIADB_TAG=$MARIADB_TAG WORDPRESS_TAG=$WORDPRESS_TAG NODE_TAG=$NODE_TAG + make test \ + WORDPRESS_CONTAINER_HOST=wordpress \ + NODE_CONTAINER_HOST=node \ + MARIADB_TAG=$MARIADB_TAG \ + WORDPRESS_TAG=$WORDPRESS_TAG \ + NODE_TAG=$NODE_TAG make down diff --git a/Makefile b/Makefile index 53e563a..5fda568 100644 --- a/Makefile +++ b/Makefile @@ -61,8 +61,10 @@ GITHUB_TOKEN ?= MODE ?= develop WORDPRESS_CONTAINER_NAME=wordpress +WORDPRESS_CONTAINER_HOST ?= localhost WORDPRESS_CONTAINER_USER=root NODE_CONTAINER_NAME=node +NODE_CONTAINER_HOST ?= localhost NODE_CONTAINER_USER=root NODE_CONTAINER_BUILD_DIR=/app/build TMP_DIR=tmp @@ -124,8 +126,8 @@ set-env: wait: @echo "Waiting for services to be ready" - @$(TMP_DIR)/wait-for-it.sh 127.0.0.1:80 --timeout=300 --strict -- echo "WordPress is up" - @$(TMP_DIR)/wait-for-it.sh 127.0.0.1:$(NODE_PORT) --timeout=300 --strict -- echo "Node is up" + @$(TMP_DIR)/wait-for-it.sh $(WORDPRESS_CONTAINER_HOST):80 --timeout=300 --strict -- echo "WordPress is up" + @$(TMP_DIR)/wait-for-it.sh $(NODE_CONTAINER_HOST):$(NODE_PORT) --timeout=300 --strict -- echo "Node is up" @echo "Waiting for WordPress to complete setup" @$(DOCKER_COMPOSE) exec -u$(WORDPRESS_CONTAINER_USER) $(WORDPRESS_CONTAINER_NAME) sh -c 'timeout=300; while [ $$timeout -gt 0 ]; do [ -f $${WORDPRESS_CONF_FILE:-/bitnami/wordpress/wp-config.php} ] && break; echo "Waiting for wp-config.php..."; sleep 5; timeout=$$((timeout - 5)); done; [ $$timeout -gt 0 ]'