Skip to content

Commit

Permalink
Add wait for endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
DonRichards committed Oct 20, 2023
1 parent 9c2e740 commit 3039315
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions custom.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ else
SERVER_TYPE = local
endif

.PHONY: wait-for-endpoint
.SILENT: wait-for-endpoint
wait-for-endpoint:
@echo "Checking if the https://$(DOMAIN)/ endpoint is available..."
@while ! curl -k -s -o /dev/null -w "%{http_code}" https://$(DOMAIN)/ | grep -q "200"; do \
echo "Waiting for https://$(DOMAIN)/ endpoint to be available..."; \
sleep 5; \
done
@echo "Endpoint is available!"

.PHONY: jhu_check_and_warn
.SILENT: jhu_check_and_warn
jhu_check_and_warn:
Expand Down Expand Up @@ -146,10 +156,12 @@ jhu_up: jhu_generate-secrets
docker-compose exec -T drupal with-contenv bash -lc 'mkdir -p /var/www/drupal/private ; chown -R nginx:nginx /var/www/drupal/private ; chmod -R 755 /var/www/drupal/private'
sudo rsync -avz scripts/services.yml codebase/web/sites/default/services.yml
sudo rsync -avz scripts/default.services.yml codebase/web/sites/default/default.services.yml
$(MAKE) wait-for-endpoint
curl -k -u admin:$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD) -H "Content-Type: application/json" -d "@build/demo-data/jhu_homepage.json" https://${DOMAIN}/node?_format=json
curl -k -u admin:$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD) -H "Content-Type: application/json" -d "@build/demo-data/browse-collections.json" https://${DOMAIN}/node?_format=json
docker-compose down
docker-compose up -d
# drush config:set system.logging error_level verbose -y

.PHONY: jhu_demo_content
.SILENT: jhu_demo_content
Expand Down

0 comments on commit 3039315

Please sign in to comment.