@@ -19,46 +19,9 @@ curl -k -w "%{http_code}\n" -o /dev/null -f -s \
1919 " ${ADMIN_BASE_URL} packages/install" \
2020| grep -q " $STATUS_SEE_OTHER "
2121
22- # Purge cache after install to clear any cached 404 responses
23- purge_cache " $END_USER_VARNISH_SERVICE "
24- purge_cache " $ADMIN_VARNISH_SERVICE "
25- purge_cache " $FRONTEND_VARNISH_SERVICE "
26-
27- # Wait for package installation to complete (poll for stylesheet availability)
28- elapsed=0
29- iteration=0
30- while [ $( echo " $elapsed < 30" | bc) -eq 1 ]; do
31- # Get status and headers via proxy in one request
32- proxy_response=$( curl -k -s -I " ${END_USER_BASE_URL} static/com/linkeddatahub/packages/skos/layout.xsl" )
33- stylesheet_status=$( echo " $proxy_response " | head -1 | grep -oE ' [0-9]{3}' )
34-
35- iteration=$(( iteration + 1 ))
36-
37- # Only break on success after at least 2 iterations (to see Age > 0)
38- if [ " $stylesheet_status " = " 200" ] && [ $iteration -ge 2 ]; then
39- break
40- fi
41-
42- echo " --- Waiting for stylesheet (${elapsed} s) ---"
43- echo " Via proxy: HTTP $stylesheet_status "
44- echo " $proxy_response " | grep -E " (Age|X-Cache|X-Varnish)" || echo " (no cache headers)"
45-
46- # Check file on disk
47- docker compose exec -T linkeddatahub ls -l webapps/ROOT/static/com/linkeddatahub/packages/skos || echo " Directory does not exist"
48-
49- # Test direct access to Tomcat (bypasses Varnish/Nginx cache)
50- internal_status=$( docker compose exec -T nginx curl -s -w " %{http_code}\n" -o /dev/null http://linkeddatahub:8080/static/com/linkeddatahub/packages/skos/layout.xsl)
51- echo " Direct Tomcat: HTTP $internal_status "
52-
53- sleep 0.5
54- elapsed=$( echo " $elapsed + 0.5" | bc)
55- done
56-
57- if [ " $stylesheet_status " != " 200" ]; then
58- echo " --- Final check after timeout ---"
59- docker compose exec -T linkeddatahub ls -l webapps/ROOT/static/com/linkeddatahub/packages/skos || echo " Directory does not exist"
60- exit 1
61- fi
22+ # the stylesheet is not available via URL right away. If we request it right away, Varnish will cache a 404 Not Found response for it
23+ # TO-DO: make sure the stylesheet URL is available immediately after installation
24+ sleep 1
6225
6326# verify package stylesheet was installed (should return 200)
6427curl -k -f -s -o /dev/null \
0 commit comments