From 48c55859bae0a21766c7d5cc2fce92f655908a8f Mon Sep 17 00:00:00 2001 From: Eric Van Norman Date: Tue, 25 May 2021 16:04:20 -0500 Subject: [PATCH] Add update_test_reference target and cleanup old target (#9843) --- Makefile.core.mk | 7 ++++-- scripts/grab_examples.sh | 51 ---------------------------------------- 2 files changed, 5 insertions(+), 53 deletions(-) delete mode 100755 scripts/grab_examples.sh diff --git a/Makefile.core.mk b/Makefile.core.mk index 0f29532846..bf0ac405ea 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -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 diff --git a/scripts/grab_examples.sh b/scripts/grab_examples.sh deleted file mode 100755 index 4057a148de..0000000000 --- a/scripts/grab_examples.sh +++ /dev/null @@ -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