Skip to content

Commit

Permalink
Experimental bazel support
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Jun 17, 2016
1 parent 3c32ec2 commit a5e7812
Show file tree
Hide file tree
Showing 12 changed files with 610 additions and 0 deletions.
5 changes: 5 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
load("@io_bazel_rules_go//go:def.bzl", "go_prefix")

go_prefix("github.com/kopeio/aws-controller")


65 changes: 65 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
git_repository(
name = "io_bazel_rules_go",
remote = "https://github.com/bazelbuild/rules_go.git",
commit = "53d012d785e2d5c693627c27b95c4185bbeb7d36",
)
load("@io_bazel_rules_go//go:def.bzl", "go_repositories")

go_repositories()



http_file(
name = "pkg_coreutils",
url = "http://ftp.us.debian.org/debian/pool/main/c/coreutils/coreutils_8.23-4_amd64.deb"
)

http_file(
name = "pkg_libacl1",
url = "http://ftp.us.debian.org/debian/pool/main/a/acl/libacl1_2.2.52-2_amd64.deb"
)

http_file(
name = "pkg_libattr1",
url = "http://ftp.us.debian.org/debian/pool/main/a/attr/libattr1_2.4.47-2_amd64.deb"
)

http_file(
name = "pkg_libc6",
url = "http://ftp.us.debian.org/debian/pool/main/g/glibc/libc6_2.19-18+deb8u4_amd64.deb"
)

http_file(
name = "pkg_libselinux1",
url = "http://ftp.us.debian.org/debian/pool/main/libs/libselinux/libselinux1_2.3-2_amd64.deb"
)

http_file(
name = "pkg_libpcre3",
url = "http://ftp.us.debian.org/debian/pool/main/p/pcre3/libpcre3_8.35-3.3+deb8u4_amd64.deb"
)

http_file(
name = "pkg_libgcc1",
url = "http://ftp.us.debian.org/debian/pool/main/g/gcc-4.9/libgcc1_4.9.2-10_amd64.deb"
)

http_file(
name = "pkg_gcc_4_9_base",
url = "http://ftp.us.debian.org/debian/pool/main/g/gcc-4.9/gcc-4.9-base_4.9.2-10_amd64.deb"
)

http_file(
name = "pkg_dash",
url = "http://ftp.us.debian.org/debian/pool/main/d/dash/dash_0.5.7-4+b1_amd64.deb"
)

http_file(
name = "pkg_debianutils",
url = "http://ftp.us.debian.org/debian/pool/main/d/debianutils/debianutils_4.4+b1_amd64.deb"
)

http_file(
name = "pkg_sensible_utils",
url = "http://ftp.us.debian.org/debian/pool/main/s/sensible-utils/sensible-utils_0.0.9_all.deb"
)
18 changes: 18 additions & 0 deletions cmd/aws-controller/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_go//go:def.bzl", "go_binary")

go_binary(
name = "aws-controller",
srcs = glob(
include = ["*.go"],
exclude = ["*_test.go"],
),
deps = [
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
"//pkg:awscontroller/instances",
"//pkg:kope",
"//pkg:kope/kopeaws",
],
)
8 changes: 8 additions & 0 deletions images/aws-controller/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build")

docker_build(
name = "aws-controller",
base = "//images/jessie:dash",
files = [ "//cmd/aws-controller", ],
cmd = [ "/aws-controller" ],
)
25 changes: 25 additions & 0 deletions images/jessie/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package(default_visibility = ["//visibility:public"])

load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build")

docker_build(
name = "minimal",
debs = [ "@pkg_coreutils//file",
"@pkg_libacl1//file",
"@pkg_libattr1//file",
"@pkg_libc6//file",
"@pkg_libselinux1//file",
"@pkg_libpcre3//file",
"@pkg_libgcc1//file",
"@pkg_gcc_4_9_base//file"
],
cmd = [ "/bin/ls", "/" ],
)

docker_build(
name = "dash",
base = "minimal",
debs = [ "@pkg_dash//file",
],
cmd = [ "/bin/ls", "/" ],
)
61 changes: 61 additions & 0 deletions pkg/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "awscontroller/instances",
srcs = glob(
include = ["awscontroller/instances/*.go"],
exclude = ["awscontroller/instances/*_test.go"],
),
deps = [
":kope",
":kope/kopeaws",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
"//vendor/github.com/aws/aws-sdk-go:aws",
"//vendor/github.com/aws/aws-sdk-go:service/ec2",
"//vendor/k8s.io/kubernetes:pkg/util/runtime",
"//vendor/k8s.io/kubernetes:pkg/util/wait",
],
)

go_library(
name = "kope",
srcs = glob(
include = ["kope/*.go"],
exclude = ["kope/*_test.go"],
),
deps = [
"//vendor/github.com/golang/glog:go_default_library",
],
)

go_library(
name = "kope/kopeaws",
srcs = glob(
include = ["kope/kopeaws/*.go"],
exclude = ["kope/kopeaws/*_test.go"],
),
deps = [
":kope",
":kope/utils",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/aws/aws-sdk-go:aws",
"//vendor/github.com/aws/aws-sdk-go:aws/ec2metadata",
"//vendor/github.com/aws/aws-sdk-go:aws/request",
"//vendor/github.com/aws/aws-sdk-go:aws/session",
"//vendor/github.com/aws/aws-sdk-go:service/ec2",
"//vendor/github.com/aws/aws-sdk-go:service/route53",
],
)

go_library(
name = "kope/utils",
srcs = glob(
include = ["kope/utils/*.go"],
exclude = ["kope/utils/*_test.go"],
),
deps = [
],
)
Loading

0 comments on commit a5e7812

Please sign in to comment.