Commit 7467920 1 parent c838130 commit 7467920 Copy full SHA for 7467920
File tree 4 files changed +55
-2
lines changed
4 files changed +55
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ services:
26
26
before_install :
27
27
# NOTE: The latest version of dep requires go 1.13
28
28
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p /Users/travis/gopath/bin; fi
29
- - GO111MODULE=on curl https://raw.githubusercontent.com/golang/dep/v0.5.1/install.sh | sh
30
29
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then GO111MODULE=on scripts/install_and_setup.sh; fi
31
30
32
31
before_script :
Original file line number Diff line number Diff line change @@ -116,7 +116,11 @@ function fetch_tools {
116
116
if [ -n " $SKIP_FETCH_TOOLS " ]; then
117
117
return 0
118
118
fi
119
+ fetch_go_tools
120
+ fetch_kb_tools
121
+ }
119
122
123
+ function fetch_kb_tools {
120
124
header_text " fetching tools"
121
125
kb_tools_archive_name=" kubebuilder-tools-$k8s_version -$goos -$goarch .tar.gz"
122
126
kb_tools_download_url=" https://storage.googleapis.com/kubebuilder-tools/$kb_tools_archive_name "
@@ -138,7 +142,32 @@ function build_kb {
138
142
opts=-ldflags " -X sigs.k8s.io/kubebuilder/cmd/version.kubeBuilderVersion=$INJECT_KB_VERSION "
139
143
fi
140
144
141
- go build $opts -o $tmp_root /kubebuilder/bin/kubebuilder ./cmd
145
+ GO111MODULE=on go build $opts -o $tmp_root /kubebuilder/bin/kubebuilder ./cmd
146
+ }
147
+
148
+ function fetch_go_tools {
149
+ header_text " Checking for dep"
150
+ export PATH=$( go env GOPATH) /src/github.com/golang/dep/bin:$PATH
151
+ if ! is_installed dep ; then
152
+ header_text " Installing dep"
153
+ DEP_DIR=$( go env GOPATH) /src/github.com/golang/dep
154
+ mkdir -p $DEP_DIR
155
+ pushd $DEP_DIR
156
+ git clone https://github.com/golang/dep.git .
157
+ DEP_LATEST=$( git describe --abbrev=0 --tags)
158
+ git checkout $DEP_LATEST
159
+ mkdir bin
160
+ go build -ldflags=" -X main.version=$DEP_LATEST " -o bin/dep ./cmd/dep
161
+ popd
162
+ fi
163
+
164
+ }
165
+
166
+ function is_installed {
167
+ if command -v $1 & > /dev/null; then
168
+ return 0
169
+ fi
170
+ return 1
142
171
}
143
172
144
173
function prepare_testdir_under_gopath {
Original file line number Diff line number Diff line change @@ -77,6 +77,12 @@ curl -L "$URL"| tar xz -C $TMP_DIR
77
77
echo " Downloaded executable files"
78
78
ls " ${KUBEBUILDER_VERSION_NAME} _${OSEXT} _${ARCH} /bin"
79
79
80
+ if [[ -z " ${PROW} " ]]; then
81
+ MOVE=" sudo mv"
82
+ else
83
+ MOVE=" mv"
84
+ fi
85
+
80
86
echo " Moving files to $KUBEBUILDER_DIR folder\n"
81
87
mv ${KUBEBUILDER_VERSION_NAME} _${OSEXT} _${ARCH} kubebuilder && sudo mv -f kubebuilder /usr/local/
82
88
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # Copyright 2018 The Kubernetes Authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ export TRACE=1
17
+ export GO111MODULE=on
18
+
19
+ ./test.sh
You can’t perform that action at this time.
0 commit comments