mirror of https://github.com/istio/istio.io.git
Allow to override istio/api Git URL (#10366)
This allows to override the default istio/api Git repo URL (https://github.com/istio/api.git) with something else, for example, a local directory, hence we can check how the documentation generated from *.proto is rendered and layouted. Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
This commit is contained in:
parent
1901cf2980
commit
65c240814e
|
@ -142,8 +142,21 @@ netlify: netlify_install
|
|||
@scripts/build_site.sh "/latest"
|
||||
@scripts/include_archive_site.sh
|
||||
|
||||
# ISTIO_API_GIT_SOURCE allows to override the default Istio API repository, https://github.com/istio/api@$(SOURCE_BRANCH_NAME)
|
||||
# with, for example, a mapped local directory: file:///work/istio/api@branch-name when running `update_ref_docs`.
|
||||
#
|
||||
# The format for ISTIO_API_GIT_SOURCE value is {GIT_URL}@{TARGET_BRANCH_NAME}.
|
||||
#
|
||||
# Note that when running with BUILD_WITH_CONTAINER=1, we can map the local directory by setting
|
||||
# the ADDITIONAL_CONTAINER_OPTIONS environment variable as shown in the below example:
|
||||
#
|
||||
# $ BUILD_WITH_CONTAINER=1 \
|
||||
# ISTIO_API_GIT_SOURCE="file:///work/istio/api@branchname" \
|
||||
# ADDITIONAL_CONTAINER_OPTIONS="-v /path/to/local/istio/api:/work/istio/api" \
|
||||
# make update_ref_docs
|
||||
export ISTIO_API_GIT_SOURCE ?=
|
||||
update_ref_docs:
|
||||
@scripts/grab_reference_docs.sh $(SOURCE_BRANCH_NAME)
|
||||
@scripts/grab_reference_docs.sh $(SOURCE_BRANCH_NAME) $(ISTIO_API_GIT_SOURCE)
|
||||
|
||||
update_test_reference:
|
||||
@go get istio.io/istio@$(SOURCE_BRANCH_NAME) && go mod tidy
|
||||
|
|
|
@ -29,6 +29,10 @@ else
|
|||
SOURCE_BRANCH_NAME="master"
|
||||
fi
|
||||
|
||||
if [[ "$2" != "" ]]; then
|
||||
ISTIO_API_GIT_SOURCE="$2"
|
||||
fi
|
||||
|
||||
# The repos to mine for docs, just add new entries here to pull in more repos.
|
||||
REPOS=(
|
||||
https://github.com/istio/istio.git@"${SOURCE_BRANCH_NAME}"
|
||||
|
@ -99,6 +103,10 @@ handle_feature_status_scraping() {
|
|||
|
||||
handle_doc_scraping() {
|
||||
for repo in "${REPOS[@]}"; do
|
||||
if [[ "$repo" == https://github.com/istio/api.git* ]]; then
|
||||
repo="${ISTIO_API_GIT_SOURCE:-$repo}"
|
||||
fi
|
||||
|
||||
REPO_URL=$(echo "$repo" | cut -d @ -f 1)
|
||||
REPO_BRANCH=$(echo "$repo" | cut -d @ -f 2)
|
||||
DEST_DIR=${REPO_URL//\//_}
|
||||
|
|
Loading…
Reference in New Issue