File tree Expand file tree Collapse file tree 8 files changed +26
-35
lines changed Expand file tree Collapse file tree 8 files changed +26
-35
lines changed Original file line number Diff line number Diff line change 1
- testdata /* .tgz filter =lfs diff =lfs merge =lfs - text
Original file line number Diff line number Diff line change 14
14
15
15
git :
16
16
depth : 3
17
- lfs_skip_smudge : true
18
17
19
18
go_import_path : sigs.k8s.io/kubebuilder
20
19
@@ -23,12 +22,9 @@ services:
23
22
24
23
before_install :
25
24
- go get -u github.com/golang/dep/cmd/dep
26
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -sL https://github.com/git-lfs/git-lfs/releases/download/v2.7.2/git-lfs-darwin-amd64-v2.7.2.tar.gz | tar -xz git-lfs; fi
27
25
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then GO111MODULE=on scripts/install_and_setup.sh; fi
28
26
29
27
before_script :
30
- - git lfs install
31
- - git lfs pull
32
28
33
29
# Install must be set to prevent default `go get` to run.
34
30
# The dependencies have already been vendored by `dep` so
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ Kubernetes projects require that you sign a Contributor License Agreement (CLA)
7
7
Please see https://git.k8s.io/community/CLA.md for more info.
8
8
9
9
## Contributing steps
10
- 1 . Setup [ Git LFS plugin] ( https://git-lfs.github.com/ )
11
10
1 . Submit an issue describing your proposed change to the repo in question.
12
11
1 . The [ repo owners] ( OWNERS ) will respond to your issue promptly.
13
12
1 . If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above).
@@ -16,13 +15,9 @@ Please see https://git.k8s.io/community/CLA.md for more info.
16
15
17
16
## How to build kubebuilder locally
18
17
19
- 1 . Setup Git LFS
20
- Install the git-lfs plugin using the instructions from [ git-lfs] ( https://git-lfs.github.com/ ) page.
21
- Once installed, run ` git lfs install ` in your repo to setup git lfs hooks.
22
-
23
18
1 . Build
24
19
``` sh
25
- $ go build -o /output/path/kubebuilder ./cmd
20
+ $ make build
26
21
```
27
22
28
23
1 . Test
Original file line number Diff line number Diff line change @@ -160,9 +160,22 @@ function setup_envs {
160
160
export KUBECONFIG=" $( kind get kubeconfig-path --name=" kind" ) "
161
161
}
162
162
163
+ # download_vendor_archive downloads vendor tarball for v1 projects. It skips the
164
+ # download if tarball exists.
165
+ function download_vendor_archive {
166
+ archive_name=" vendor.v1.tgz"
167
+ archive_download_url=" https://storage.googleapis.com/kubebuilder-vendor/$archive_name "
168
+ archive_path=" $tmp_root /$archive_name "
169
+ if [ ! -f $archive_path ]; then
170
+ header_text " downloading vendor archive $archive_path "
171
+ curl -sL ${archive_download_url} -o " $archive_path "
172
+ fi
173
+ }
174
+
163
175
function restore_go_deps {
164
176
header_text " restoring Go dependencies"
165
- tar -zxf ${go_workspace} /src/sigs.k8s.io/kubebuilder/testdata/vendor.v1.tgz
177
+ download_vendor_archive
178
+ tar -zxf $tmp_root /vendor.v1.tgz
166
179
}
167
180
168
181
function cache_project {
Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ scaffold_test_project() {
43
43
export GO111MODULE=auto
44
44
export GOPATH=$( pwd) /../.. # go ignores vendor under testdata, so fake out a gopath
45
45
# untar Gopkg.lock and vendor directory for appropriate project version
46
- tar -zxf $testdata_dir /vendor.v$version .tgz
46
+ download_vendor_archive
47
+ tar -zxf $tmp_root /vendor.v$version .tgz
47
48
48
49
$kb init --project-version $version --domain testproject.org --license apache2 --owner " The Kubernetes authors" --dep=false
49
50
$kb create api --group crew --version v1 --kind FirstMate --controller=true --resource=true --make=false
@@ -80,12 +81,6 @@ scaffold_test_project() {
80
81
81
82
set -e
82
83
83
- if ! git lfs > /dev/null 2>&1 ; then
84
- echo " this project requires git-lfs, see: https://git-lfs.github.com/"
85
- echo " after installing, you'll need to git checkout ./testdata/*tgz"
86
- exit 1
87
- fi
88
-
89
84
build_kb
90
85
scaffold_test_project gopath/src/project 1
91
86
scaffold_test_project project-v2 2
Original file line number Diff line number Diff line change 85
85
EOF
86
86
}
87
87
88
- # download_vendor_archive downloads vendor tarball for v1 projects. It skips the
89
- # download if tarball exists.
90
- function download_vendor_archive {
91
- archive_name=" vendor.v1.tgz"
92
- archive_download_url=" https://storage.googleapis.com/kubebuilder-vendor/$archive_name "
93
- archive_path=" $tmp_root /$archive_name "
94
- if [ ! -f $archive_path ]; then
95
- header_text " downloading vendor archive $archive_path "
96
- curl -sL ${archive_download_url} -o " $archive_path "
97
- fi
98
- }
99
88
100
89
function test_project {
101
90
project_dir=$1
Original file line number Diff line number Diff line change @@ -53,11 +53,18 @@ var _ = Describe("kubebuilder", func() {
53
53
54
54
It ("should generate a runnable project" , func () {
55
55
// prepare v1 vendor
56
- By ("untar the vendor tarball" )
57
- cmd := exec .Command ("tar" , "-zxf" , "../../../testdata/vendor.v1.tgz" )
56
+ By ("downloading the vendor tarball" )
57
+ cmd := exec .Command ("wget" ,
58
+ "https://storage.googleapis.com/kubebuilder-vendor/vendor.v1.tgz" ,
59
+ "-O" , "/tmp/vendor.v1.tgz" )
58
60
_ , err := kbc .Run (cmd )
59
61
Expect (err ).Should (Succeed ())
60
62
63
+ By ("untar the vendor tarball" )
64
+ cmd = exec .Command ("tar" , "-zxf" , "/tmp/vendor.v1.tgz" )
65
+ _ , err = kbc .Run (cmd )
66
+ Expect (err ).Should (Succeed ())
67
+
61
68
var controllerPodName string
62
69
63
70
By ("init v1 project" )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments