File tree Expand file tree Collapse file tree 1 file changed +46
-3
lines changed Expand file tree Collapse file tree 1 file changed +46
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ set -e
4
+
3
5
os=$( go env GOOS)
4
6
arch=$( go env GOARCH)
5
7
8
+ # translate arch to rust's conventions (if we can)
9
+ if [[ ${arch} == " amd64" ]]; then
10
+ arch=" x86_64"
11
+ elif [[ ${arch} == " x86" ]]; then
12
+ arch=" i686"
13
+ fi
14
+
15
+ # translate os to rust's conventions (if we can)
16
+ ext=" tar.gz"
17
+ cmd=" tar -C /tmp -xzvf"
18
+ case ${os} in
19
+ windows)
20
+ target=" pc-windows-msvc"
21
+ ext=" zip"
22
+ cmd=" unzip -d /tmp"
23
+ ;;
24
+ darwin)
25
+ target=" apple-darwin"
26
+ ;;
27
+ linux)
28
+ # works for linux, too
29
+ target=" unknown-${os} -gnu"
30
+ ;;
31
+ * )
32
+ target=" unknown-${os} "
33
+ ;;
34
+ esac
35
+
6
36
# grab mdbook
7
- # mdbook's deploy got borked by a CI move, so grab our build till that gets
8
- # fixed (https://github.com/rust-lang-nursery/mdBook/issues/904).
9
- curl -sL -o /tmp/mdbook https://storage.googleapis.com/kubebuilder-build-tools/mdbook-0.2.3-${os} -${arch}
37
+ # we hardcode linux/amd64 since rust uses a different naming scheme and it's a pain to tran
38
+ echo " downloading mdBook-v0.3.1-${arch} -${target} .${ext} "
39
+ set -x
40
+ curl -sL -o /tmp/mdbook.${ext} https://github.com/rust-lang-nursery/mdBook/releases/download/v0.3.1/mdBook-v0.3.1-${arch} -${target} .${ext}
41
+ ${cmd} /tmp/mdbook.${ext}
10
42
chmod +x /tmp/mdbook
43
+
44
+ echo " grabbing the latest released controller-gen"
45
+ # TODO(directxman12): remove the @v0.2.0-beta.4 once get v0.2.0 released,
46
+ # so that we actually get the latest version
47
+ go get sigs.k8s.io/controller-tools/cmd/
[email protected]
48
+
49
+ # make sure we add the go bin directory to our path
50
+ gobin=$( go env GOBIN)
51
+ gobin=${GOBIN:- $(go env GOPATH)/ bin} # GOBIN won't always be set :-/
52
+
53
+ export PATH=${gobin} :$PATH
11
54
/tmp/mdbook build
You can’t perform that action at this time.
0 commit comments