Skip to content

Commit aa8a51a

Browse files
authored
cherry-pick baseURL fix to istio.io (#16663)
* cp 16568 * Change hash to fool tests
1 parent 5a7412f commit aa8a51a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Makefile.core.mk

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,19 @@ JUNIT_REPORT := $(shell which go-junit-report 2> /dev/null || echo "${ISTIO_BIN}
7272
ISTIO_SERVE_DOMAIN ?= localhost
7373
export ISTIO_SERVE_DOMAIN
7474

75+
# Determine the base URL for the Netlify-hosted site depending on the Hugo context.
76+
# 'production' context: Use site URL (istio.io, preliminary.istio.io or istio-staging.netlify.app)
77+
# 'deploy-preview' context: Use per-build URL (deploy-preview-16568--preliminary-istio.netlify.app)
78+
# any other context: use relative URLs
7579
ifeq ($(CONTEXT),production)
76-
baseurl := "$(URL)"
80+
NETLIFY_URL := $(URL)/latest
81+
else ifeq ($(CONTEXT),deploy-preview)
82+
NETLIFY_URL := $(DEPLOY_PRIME_URL)/latest
83+
else
84+
NETLIFY_URL := /latest
7785
endif
86+
export NETLIFY_URL
87+
7888

7989
# Which branch of the Istio source code do we fetch stuff from
8090
export SOURCE_BRANCH_NAME ?= release-1.26
@@ -153,7 +163,7 @@ netlify_install:
153163

154164
netlify: netlify_install
155165
@scripts/gen_site.sh
156-
@scripts/build_site.sh "/latest"
166+
@scripts/build_site.sh "${NETLIFY_URL}"
157167
@scripts/include_archive_site.sh
158168

159169
# ISTIO_API_GIT_SOURCE allows to override the default Istio API repository, https://github.com/istio/api@$(SOURCE_BRANCH_NAME)

0 commit comments

Comments
 (0)