mirror of https://github.com/istio/istio.io.git
Add update_test_reference target and cleanup old target (#9843)
This commit is contained in:
parent
8c3d5f80ef
commit
48c55859ba
|
|
@ -140,7 +140,10 @@ netlify: netlify_install
|
|||
update_ref_docs:
|
||||
@scripts/grab_reference_docs.sh $(SOURCE_BRANCH_NAME)
|
||||
|
||||
update_all: update_ref_docs update_examples
|
||||
update_test_reference:
|
||||
@go get istio.io/istio@$(SOURCE_BRANCH_NAME) && go mod tidy
|
||||
|
||||
update_all: update_ref_docs update_test_reference
|
||||
|
||||
foo2:
|
||||
hugo version
|
||||
|
|
@ -200,4 +203,4 @@ test_status:
|
|||
|
||||
include common/Makefile.common.mk
|
||||
|
||||
.PHONY: site gen build build_nominify opt clean_public clean lint serve netlify_install netlify netlify_archive archive update_ref_docs update_operator_yamls update_examples update_all
|
||||
.PHONY: site gen build build_nominify opt clean_public clean lint serve netlify_install netlify netlify_archive archive update_ref_docs update_operator_yamls update_all
|
||||
|
|
|
|||
|
|
@ -1,51 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright Istio Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This script copies test snippets from documentation tests in the istio/istio repo.
|
||||
# These snippets are put into the examples directory and referenced from markdown files
|
||||
# throughout the site.
|
||||
|
||||
if [[ "$1" != "" ]]; then
|
||||
SOURCE_BRANCH_NAME="$1"
|
||||
else
|
||||
SOURCE_BRANCH_NAME="master"
|
||||
fi
|
||||
|
||||
SNIPPET_REPO=https://github.com/istio/istio
|
||||
|
||||
rm -fr examples/*.snippets.txt
|
||||
|
||||
echo Cloning "${SNIPPET_REPO}@${SOURCE_BRANCH_NAME}"
|
||||
|
||||
WORK_DIR="$(mktemp -d)"
|
||||
mkdir -p "${WORK_DIR}"
|
||||
git clone -q -b """${SOURCE_BRANCH_NAME}""" "${SNIPPET_REPO}" "${WORK_DIR}"
|
||||
COMMITS=$(git --git-dir="${WORK_DIR}/.git" log --oneline --no-abbrev-commit | cut -d " " -f 1)
|
||||
rm -fr "${WORK_DIR}"
|
||||
|
||||
echo "Querying for snippets"
|
||||
|
||||
# iterate through all the commits for the repo until we find one that has the needed artifacts
|
||||
# in gcs
|
||||
for COMMIT in $COMMITS; do
|
||||
if gsutil -m cp "gs://istio-snippets/${COMMIT}/*.txt" examples; then
|
||||
echo "Example snippets updated"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Unable to download example snippets"
|
||||
exit 1
|
||||
Loading…
Reference in New Issue