|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright 2017 The Kubernetes Authors. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +# Script to fetch latest swagger spec. |
| 18 | +# Puts the updated spec at api/swagger-spec/ |
| 19 | + |
| 20 | +set -o errexit |
| 21 | +set -o nounset |
| 22 | +set -o pipefail |
| 23 | + |
| 24 | +RUNNING_DIR=$(pwd) |
| 25 | +TMP_DIR=$(mktemp -d) |
| 26 | + |
| 27 | +function cleanup() |
| 28 | +{ |
| 29 | + cd "${RUNNING_DIR}" |
| 30 | +} |
| 31 | +trap cleanup EXIT SIGINT |
| 32 | + |
| 33 | + |
| 34 | +SCRIPT_ROOT=$(dirname "${BASH_SOURCE}") |
| 35 | +pushd "${SCRIPT_ROOT}" > /dev/null |
| 36 | +SCRIPT_ROOT=`pwd` |
| 37 | +popd > /dev/null |
| 38 | + |
| 39 | +cd "${TMP_DIR}" |
| 40 | +git clone https://github.com/kubernetes-incubator/client-python.git |
| 41 | +cd client-python |
| 42 | +git config user.email "[email protected]" |
| 43 | +git config user.name "kubenetes client" |
| 44 | +git rm -rf kubernetes/base |
| 45 | +git commit -m "DO NOT MERGE, removing submodule for testing only" |
| 46 | +mkdir kubernetes/base |
| 47 | +cp -r "${SCRIPT_ROOT}/." kubernetes/base |
| 48 | +rm -rf kubernetes/base/.git |
| 49 | +rm -rf kubernetes/base/.tox |
| 50 | +git add kubernetes/base |
| 51 | +git commit -m "DO NOT MERGE, adding changes for testing." |
| 52 | +git status |
| 53 | + |
| 54 | +echo "Running tox from the main repo on $TOXENV environment" |
| 55 | +# Run the user-provided command. |
| 56 | +"${@}" |
| 57 | + |
0 commit comments