jetstack / navigator

Managed Database-as-a-Service (DBaaS) on Kubernetes
Apache License 2.0
271 stars 31 forks source link

Add experimental bazel build files #145

Closed munnerz closed 6 years ago

munnerz commented 6 years ago

What this PR does / why we need it:

Adds bazel build rules for building and running navigator

Special notes for your reviewer:

This is an experiment to see how bazel works for us. This would allow us to define all the dependencies needed to build/test/run/release navigator and have them automatically set up and configured (e.g. correct go version, gopath, build docker images and pushing them etc). It also lets you build navigator locally quickly.

This would also mean we can provide a single test-infra image that only contains bazel that can be shared between all projects and build stages. This could eventually become a replacement for make.

Release note:

Add experimental Bazel build files
jetstack-ci-bot commented 6 years ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: We suggest the following additional approver: wallrj

Assign the PR to them by writing /assign @wallrj in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files: - **[OWNERS](https://github.com/jetstack/navigator/blob/master/OWNERS)** You can indicate your approval by writing `/approve` in a comment You can cancel your approval by writing `/approve cancel` in a comment
wallrj commented 6 years ago
bazel version
Build label: 0.7.0- (@non-git)
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Oct 31 18:20:15 2017 (1509474015)
Build timestamp: 1509474015
Build timestamp as int: 1509474015
wallrj commented 6 years ago

I quickly tried this again, but got the following error:

bazel test //...
..................
ERROR: /home/richard/projects/golang/src/github.com/jetstack/navigator/vendor/k8s.io/apiserver/pkg/util/feature/BUILD:34:1: no such package 'staging/src/k8s.io/apiserver/pkg/util/feature/testing': BUILD file not found on package path and referenced by '//vendor/k8s.io/apiserver/pkg/util/feature:all-srcs'.
ERROR: Analysis of target '//vendor/k8s.io/apiserver/pkg/util/feature:all-srcs' failed; build aborted: Loading failed.
INFO: Elapsed time: 11.284s
ERROR: Couldn't start the build. Unable to run tests.

Let me know if / when you want me to retest.