From ac3a18a5363afeb81c78c9df1cfe6f9211564b51 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Mon, 13 Nov 2023 20:28:55 +1100 Subject: [PATCH 1/2] DWP wait for the API --- local-dev/api-data-watcher-pusher/data-init-push.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/local-dev/api-data-watcher-pusher/data-init-push.sh b/local-dev/api-data-watcher-pusher/data-init-push.sh index b7025a8c93..75c990462c 100755 --- a/local-dev/api-data-watcher-pusher/data-init-push.sh +++ b/local-dev/api-data-watcher-pusher/data-init-push.sh @@ -9,6 +9,12 @@ populate_demo_lagoon_org_gql_file_path="/home/api-data/02-populate-api-data-lago populate_ci_local_control_k8s_gql_file_path="/home/api-data/03-populate-api-data-ci-local-control-k8s.gql" sample_task_file_path="/home/minio-data/task-files/sample-task-file.txt" +wait_for_services() { + echo "waiting for ${API_HOST:-api}:${API_PORT:-3000}" + wait-for ${API_HOST:-api}:${API_PORT:-3000} -t 600 + echo "connected to API" +} + send_graphql_query() { local file_path=${1} @@ -46,6 +52,9 @@ send_task_data() { -F 0=@${file_path} } +# Waiting for the API to be ready +wait_for_services + # Optionally clear *some* API data prior to reloading - not really necessary any more # send_graphql_query $clear_gql_file_path From bb9e1ba88dbf21968165c73e4c9ce681d41b87e8 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Tue, 14 Nov 2023 16:58:01 +1100 Subject: [PATCH 2/2] remove minio-upload from makefile routines --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 955913989b..5163856cf4 100644 --- a/Makefile +++ b/Makefile @@ -253,7 +253,7 @@ wait-for-keycloak: grep -m 1 "Config of Keycloak done." <(docker-compose -p $(CI_BUILD_TAG) --compatibility logs -f keycloak 2>&1) # Define a list of which Lagoon Services are needed for running any deployment testing -main-test-services = actions-handler broker logs2notifications api api-db api-redis keycloak keycloak-db ssh auth-server local-git local-api-data-watcher-pusher local-minio local-minio-upload +main-test-services = actions-handler broker logs2notifications api api-db api-redis keycloak keycloak-db ssh auth-server local-git local-api-data-watcher-pusher local-minio # List of Lagoon Services needed for webhook endpoint testing webhooks-test-services = webhook-handler webhooks2tasks backup-handler @@ -354,7 +354,7 @@ api-development: build-ui-logs-development .PHONY: ui-logs-development ui-logs-development: build-ui-logs-development - IMAGE_REPO=$(CI_BUILD_TAG) docker-compose -p $(CI_BUILD_TAG) --compatibility up -d api api-db actions-handler local-api-data-watcher-pusher ui keycloak keycloak-db broker api-redis logs2notifications local-minio local-minio-upload mailhog + IMAGE_REPO=$(CI_BUILD_TAG) docker-compose -p $(CI_BUILD_TAG) --compatibility up -d api api-db actions-handler local-api-data-watcher-pusher ui keycloak keycloak-db broker api-redis logs2notifications local-minio mailhog ## CI targets