Update some of the build infra

This commit is contained in:
Reid 'arrdem' McKenzie 2022-11-19 23:54:45 -07:00
parent 28f0b369a1
commit 563aa01c2c
3 changed files with 76 additions and 5 deletions

View file

@ -41,7 +41,7 @@ git_repository(
name = "rules_python",
remote = "https://github.com/bazelbuild/rules_python.git",
# tag = "0.4.0",
commit = "888fa20176cdcaebb33f968dc7a8112fb678731d",
commit = "f0efec5cf8c0ae16483ee677a09ec70737a01bf5",
)
register_toolchains("//tools/python:python3_toolchain")
@ -64,8 +64,8 @@ install_deps()
git_repository(
name = "rules_zapp",
remote = "https://github.com/arrdem/rules_zapp.git",
commit = "d7a0382927fb8a68115b560f4fee7dca743068f8",
remote = "https://git.arrdem.com/arrdem/rules_zapp.git",
commit = "c11c64f557410ec21a2a717381928670a244d21d",
# tag = "0.1.2",
)
@ -73,3 +73,65 @@ git_repository(
# name = "rules_zapp",
# path = "/home/arrdem/doc/hobby/programming/lang/python/rules_zapp",
# )
####################################################################################################
# Docker support
####################################################################################################
http_archive(
name = "io_bazel_rules_docker",
sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
)
load("@io_bazel_rules_docker//toolchains/docker:toolchain.bzl",
docker_toolchain_configure="toolchain_configure"
)
docker_toolchain_configure(
name = "docker_config",
docker_flags = [
],
)
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load(
"@io_bazel_rules_docker//repositories:deps.bzl",
container_deps = "deps"
)
container_deps()
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_pull",
)
# container_pull(
# name = "python_base",
# registry = "index.docker.io",
# repository = "library/python",
# tag = "3.10.8-alpine"
# # sha256 = "digest:d78a749034380426dd6cec6a0db139459ca701630533ffce112adbcdd996fddd",
# )
# container_pull(
# name = "python_base",
# registry = "gcr.io",
# repository = "distroless/python3-debian11",
# tag = "latest"
# # sha256 = "digest:d78a749034380426dd6cec6a0db139459ca701630533ffce112adbcdd996fddd",
# )
container_pull(
name = "python_base",
registry = "index.docker.io",
repository = "library/python",
tag = "3.11-buster"
# sha256 = "digest:d78a749034380426dd6cec6a0db139459ca701630533ffce112adbcdd996fddd",
)

View file

@ -30,3 +30,10 @@ load("//tools/build_rules:webp.bzl",
load("@rules_zapp//zapp:zapp.bzl",
"zapp_binary",
)
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_image",
"container_bundle",
"container_push",
)

View file

@ -158,6 +158,7 @@ py_resources = rule(
def py_project(name=None,
main=None,
main_deps=None,
shebang=None,
lib_srcs=None,
lib_deps=None,
lib_data=None,
@ -238,6 +239,7 @@ def py_project(name=None,
visibility = [
"//visibility:public",
],
shebang = shebang,
)
for src in test_srcs: