chore: make the git clone k/k repo with a single specific branch. (#19664)

pull/19878/head
Jacky Wu 2020-03-27 10:48:22 +08:00 committed by GitHub
parent b5433ed594
commit ad54f03c1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -6,10 +6,12 @@ repos:
branch: master
generate-command: |
cd $GOPATH
git clone https://github.com/kubernetes/kubernetes.git src/k8s.io/kubernetes
# set the branch, ex: v1.17.0 while K8S_RELEASE=1.17
# CAUTION: The script won't work if you set K8S_RELEASE=1.18 before 1.18 is formally released.
# The `v${K8S_RELEASE}.0` string must be a valid tag name from the kubernetes repo, which
# is only created after the formal release.
git clone --depth=1 --single-branch --branch v${K8S_RELEASE}.0 https://github.com/kubernetes/kubernetes.git src/k8s.io/kubernetes
cd src/k8s.io/kubernetes
# set the branch, ex: v1.17.0
git checkout v${K8S_RELEASE}.0
make generated_files
cp -L -R vendor $GOPATH/src
rm -r vendor/github.com/spf13/cobra