blob: 9bfb7164c51469d8c40571014496cea4aa52ecd7 [file] [log] [blame]
workspace(name = "prow_presubmit")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load(
"@bazel_tools//tools/build_defs/repo:git.bzl",
"git_repository",
"new_git_repository",
)
# import container build/push rules
http_archive(
name = "io_bazel_rules_docker",
sha256 = "3556d4972571f288f8c43378295d84ed64fef5b1a875211ee1046f9f6b4258fa",
strip_prefix = "rules_docker-0.8.0",
urls = ["https://github.com/bazelbuild/rules_docker/archive/v0.8.0.tar.gz"],
)
# import bazel rules for pkg_tar and friends.
http_archive(
name = "rules_pkg",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.1/rules_pkg-0.2.1.tar.gz",
sha256 = "04c1eab736f508e94c297455915b6371432cbc4106765b5252b444d1656db051",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()
# pull latest kunitconfig
new_git_repository(
name = "kunitconfig_repo",
branch = "kunit/alpha/master",
build_file_content = """
exports_files(["kunitconfig"])
""",
remote = "https://kunit.googlesource.com/kunitconfig",
)
# pull latest kunit source for testing
new_git_repository(
name = "kunit_repo",
branch = "kunit/alpha/master",
build_file_content = """
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
pkg_tar(
name = "files",
srcs = glob(["**"]),
strip_prefix = ".",
visibility = ["//visibility:public"],
)
""",
remote = "https://kunit.googlesource.com/linux",
)
# setting container rules / base images needed
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_pull",
)
container_pull(
name = "debian_base",
registry = "index.docker.io",
repository = "library/debian",
)
# rules for installing packages from debian snapshot
git_repository(
name = "distroless",
branch = "master",
remote = "https://github.com/GoogleContainerTools/distroless",
)
load(
"@distroless//package_manager:package_manager.bzl",
"package_manager_repositories",
)
load(
"@distroless//package_manager:dpkg.bzl",
"dpkg_src",
"dpkg_list",
)
package_manager_repositories()
load("//:debs.bzl", "get_dep_list")
dpkg_src(
name = "uml",
arch = "amd64",
distro = "stretch",
sha256 = "a0c5a8906ac6ad010535cca152df43411d0e5db1790f6d0e4106bbdf96f3ef0f",
snapshot = "20181121T102052Z",
url = "http://snapshot.debian.org/archive",
)
dpkg_list(
name = "debs",
packages = get_dep_list(),
sources = [
"@uml//file:Packages.json",
],
)