mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-04 07:49:35 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
# Build with Bazel
 | 
						|
 | 
						|
Building with bazel is currently experimental. Automanaged BUILD rules have the
 | 
						|
tag "automanaged" and are maintained by
 | 
						|
[gazel](https://github.com/mikedanese/gazel). Instructions for installing bazel
 | 
						|
can be found [here](https://www.bazel.io/versions/master/docs/install.html).
 | 
						|
 | 
						|
To build docker images for the components, run:
 | 
						|
 | 
						|
```
 | 
						|
$ bazel build //build-tools/...
 | 
						|
```
 | 
						|
 | 
						|
To run many of the unit tests, run:
 | 
						|
 | 
						|
```
 | 
						|
$ bazel test //cmd/... //build-tools/... //pkg/... //federation/... //plugin/...
 | 
						|
```
 | 
						|
 | 
						|
To update automanaged build files, run:
 | 
						|
 | 
						|
```
 | 
						|
$ ./hack/update-bazel.sh
 | 
						|
```
 | 
						|
 | 
						|
 | 
						|
To update a single build file, run:
 | 
						|
 | 
						|
```
 | 
						|
$ # get gazel
 | 
						|
$ go get -u github.com/mikedanese/gazel
 | 
						|
$ # .e.g. ./pkg/kubectl/BUILD
 | 
						|
$ gazel ./pkg/kubectl
 | 
						|
```
 | 
						|
 | 
						|
Updating BUILD file for a package will be required when:
 | 
						|
* Files are added to or removed from a package
 | 
						|
* Import dependencies change for a package
 | 
						|
 | 
						|
 | 
						|
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
 | 
						|
[]()
 | 
						|
<!-- END MUNGE: GENERATED_ANALYTICS -->
 |