#!/bin/bash# Copyright 2015 The Kubernetes 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.# Script to fetch latest swagger spec.# Puts the updated spec at api/swagger-spec/set -o errexitset -o nounsetset -o pipefailENV=${VIRTUAL_ENV:-}if [[ -z ${ENV} ]]; thenif ! which virtualenv > /dev/null 2>&1; thenecho "virtualenv is not installed. run: [sudo] pip install virtualenv"exitfifiSCRIPT_ROOT=$(dirname "${BASH_SOURCE}")CLIENT_ROOT="${SCRIPT_ROOT}/../kubernetes"pushd "${SCRIPT_ROOT}" > /dev/nullSCRIPT_ROOT=`pwd`popd > /dev/nullpushd "${CLIENT_ROOT}" > /dev/nullCLIENT_ROOT=`pwd`popd > /dev/nullif [[ -z ${ENV} ]]; thenecho "--- Creating virtualenv"virtualenv "${SCRIPT_ROOT}/.py"VIRTUAL_ENV_DISABLE_PROMPT=1; source "${SCRIPT_ROOT}/.py/bin/activate"trap "deactivate" EXIT SIGINTecho "--- Updating tools"pip install --upgrade pycodestylepip install --upgrade autopep8pip install --upgrade isortfiSAVEIFS=$IFStrap "IFS=$SAVEIFS" EXIT SIGINTIFS=,SOURCES="${SCRIPT_ROOT}/../setup.py,${CLIENT_ROOT}/config/*.py,${CLIENT_ROOT}/watch/*.py,${CLIENT_ROOT}/utils/*.py,${SCRIPT_ROOT}/*.py,${CLIENT_ROOT}/../examples/*.py"echo "--- applying autopep8"for SOURCE in $SOURCES; doautopep8 -i -a -a $SOURCEdoneecho "--- applying isort"for SOURCE in $SOURCES; doisort -y $SOURCEdoneecho "--- check pycodestyle (all need to be fixed manually)"set +o errexitfor SOURCE in $SOURCES; dopycodestyle $SOURCEdoneif [[ ! -z ${ENV} ]]; thenif [[ $(git status --porcelain) != "" ]]; thencd "${SCRIPT_ROOT}/.."git --no-pager diffcd "${SCRIPT_ROOT}/../kubernetes/base"git --no-pager diffexit 1fifiecho "---Done."
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。