#!/bin/bash # Copyright 2016 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. set -o errexit set -o nounset set -o pipefail set -o xtrace proc retry { for i in [{1..5}] { @Argv && return 0 || sleep $i } @Argv } # This script is intended to be run from kubekins-test container with a # kubernetes repo mapped in. See k8s.io/test-infra/scenarios/kubernetes_verify.py export PATH=$(GOPATH)/bin:$(PWD)/third_party/etcd:/usr/local/go/bin:$(PATH) # Set artifacts directory export ARTIFACTS_DIR=$(WORKSPACE)/artifacts retry go get github.com/tools/godep && godep version export LOG_LEVEL=4 cd /go/src/k8s.io/kubernetes # hack/verify-client-go.sh requires all dependencies exist in the GOPATH. # the retry helps avoid flakes while keeping total time bounded. ./hack/godep-restore.sh || ./hack/godep-restore.sh ./hack/install-etcd.sh make verify (CommandList children: [ (C {(set)} {(-o)} {(errexit)}) (C {(set)} {(-o)} {(nounset)}) (C {(set)} {(-o)} {(pipefail)}) (C {(set)} {(-o)} {(xtrace)}) (FuncDef name: retry body: (BraceGroup children: [ (ForEach iter_name: i iter_words: [{(Lit_LBrace "{") (1..5) (Lit_RBrace "}")}] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (C {(DQ ($ VSub_At "$@"))}) (AndOr children: [ (ControlFlow token: arg_word: {(0)} ) (C {(sleep)} {($ VSub_Name "$i")}) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] spids: [87 107] ) spids: [81 85] ) (C {(DQ ($ VSub_At "$@"))}) ] spids: [73] ) spids: [69 72] ) (C {(export)} {(Lit_VarLike "PATH=") (${ VSub_Name GOPATH) (/bin) (Lit_Other ":") (${ VSub_Name PWD) (/third_party/etcd) (Lit_Other ":") (/usr/local/go/bin) (Lit_Other ":") (${ VSub_Name PATH) } ) (C {(export)} {(Lit_VarLike "ARTIFACTS_DIR=") (${ VSub_Name WORKSPACE) (/artifacts)}) (AndOr children: [(C {(retry)} {(go)} {(get)} {(github.com/tools/godep)}) (C {(godep)} {(version)})] op_id: Op_DAmp ) (C {(export)} {(Lit_VarLike "LOG_LEVEL=") (4)}) (C {(cd)} {(/go/src/k8s.io/kubernetes)}) (AndOr children: [(C {(./hack/godep-restore.sh)}) (C {(./hack/godep-restore.sh)})] op_id: Op_DPipe ) (C {(./hack/install-etcd.sh)}) (C {(make)} {(verify)}) ] )