github.com/shashidharatd/test-infra@v0.0.0-20171006011030-71304e1ca560/mungegithub/mungers/publish_scripts/publish_api.sh (about) 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 # This script publishes the latest changes in the ${src_branch} of 18 # k8s.io/kubernetes/staging/src/k8s.io/api to the ${dst_branch} of 19 # k8s.io/api. 20 # 21 # ${kubernetes_remote} is the remote url of k8s.io/kubernetes that will be used 22 # in .git/config in the local checkout of sample-apiserver. We usually set it to 23 # the local checkout of k8s.io/kubernetes to avoid multiple checkouts.This not 24 # only reduces the run time, but also ensures all published repos are generated 25 # from the same revision of k8s.io/kubernetes. 26 # 27 # The script assumes that the working directory is 28 # $GOPATH/src/k8s.io/api. 29 # 30 # The script is expected to be run by 31 # k8s.io/test-infra/mungegithub/mungers/publisher.go 32 33 set -o errexit 34 set -o nounset 35 set -o pipefail 36 37 if [ ! $# -eq 4 ]; then 38 echo "usage: $0 src_branch dst_branch dependent_k8s_repos kubernetes_remote" 39 exit 1 40 fi 41 42 SCRIPT_DIR=$(dirname "${BASH_SOURCE}") 43 "${SCRIPT_DIR}"/publish_template.sh "api" "${1}" "${2}" "${3}" "${4}" "true"