Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Update rules and fix config stripper.
Browse files Browse the repository at this point in the history
Signed-off-by: dlorenc <[email protected]>
  • Loading branch information
dlorenc authored and dlorenc committed Apr 27, 2018
1 parent 8588e7f commit 0f8509d
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 32 deletions.
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package(default_visibility = ["//visibility:public"])
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ test:
./check-fmt.sh
bazel build //... --action_env=GIT_ROOT=$(PWD) --sandbox_writable_path=$(PWD)
bazel test --test_output=errors //... --action_env=GIT_ROOT=$(PWD) --sandbox_writable_path=$(PWD)
# Check for issues with the format of our bazel config files.
buildifier -mode=check $(shell find . -name BUILD -type f)
buildifier -mode=check $(shell find . -name WORKSPACE -type f)
buildifier -mode=check $(shell find . -name '*.bzl' -type f)

complex-test:
tests/package_managers/test_complex_packages.sh
Expand Down
30 changes: 8 additions & 22 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,21 @@ to new container image, or extract specified targets to a directory on
the host machine.
"""

workspace(name = "debian_docker")

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
workspace(name = "base_images_docker")

# Docker rules.
git_repository(
name = "io_bazel_rules_docker",
commit = "f4e43196c5cef146b0a8efc46269a8beb59504bd",
commit = "452878d665648ada0aaf816931611fdd9c683a97",
remote = "https://github.com/bazelbuild/rules_docker.git",
)

git_repository(
name = "containerregistry",
commit = "d7b9bf582f672507252ebfd3cf30c3d41abf93be",
remote = "https://github.com/google/containerregistry.git",
)

load(
"@io_bazel_rules_docker//docker:docker.bzl",
"docker_repositories",
"docker_pull",
)

git_repository(
name = "containerregistry",
remote = "https://github.com/google/containerregistry.git",
tag = "v0.0.26",
)

git_repository(
name = "bazel_skylib",
remote = "https://github.com/bazelbuild/bazel-skylib.git",
Expand Down Expand Up @@ -76,8 +62,8 @@ docker_pull(

git_repository(
name = "distroless",
commit = "bd16e2028cc0dd6acba3de58448c94b3d2ead21a",
remote = "https://github.com/GoogleCloudPlatform/distroless.git",
commit = "813d1ddef217f3871e4cb0a73da100aeddc638ee",
remote = "https://github.com/GoogleContainerTools/distroless.git",
)

load(
Expand Down Expand Up @@ -126,8 +112,8 @@ dpkg_list(

http_archive(
name = "io_bazel_rules_go",
sha256 = "4d8d6244320dd751590f9100cf39fd7a4b75cd901e1f3ffdfd6f048328883695",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.9.0/rules_go-0.9.0.tar.gz",
sha256 = "f70c35a8c779bb92f7521ecb5a1c6604e9c3edd431e50b6376d7497abc8ad3c1",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.11.0/rules_go-0.11.0.tar.gz",
)

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
Expand All @@ -142,8 +128,8 @@ UBUNTU_MAP = {
"url": "https://storage.googleapis.com/ubuntu_tar/20171028/ubuntu-xenial-core-cloudimg-amd64-root.tar.gz",
},
"18_0_4": {
"sha256": "79a8d94521c680b13f27c8d01953afd43433d6c9fb3b42adb602817e53b186e3",
"url": "https://storage.googleapis.com/ubuntu_tar/20180417/ubuntu-xenial-core-cloudimg-amd64-root.tar.gz",
"sha256": "976134ce226c39610c3296a089a9e735160a2b472a67a31125a8f97f0dfbe118",
"url": "https://storage.googleapis.com/ubuntu_tar/20180417/ubuntu-bionic-core-cloudimg-amd64-root.tar.gz",
},
}

Expand Down
4 changes: 2 additions & 2 deletions check-fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ fi

echo "Checking buildifer..."
# shellcheck disable=SC2046
files=$(buildifier -mode=check $(find . -not -path "./vendor/*" -name 'BUILD' -o -name '*.bzl' -type f))
files=$(buildifier -mode=check $(find . -not -path "./vendor/*" -name 'BUILD' -type f))
if [[ $files ]]; then
echo "$files"
echo "Run 'buildifier -mode fix \$(find . -name BUILD -o -name '*.bzl' -type f)' to fix formatting"
echo "Run 'buildifier -mode fix \$(find . -name BUILD -type f)' to fix formatting"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion package_managers/install_pkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ in their rules' implementation. The expectation in such cases is that
users will write something like:
load(
"@debian_docker//package_managers:install_pkgs.bzl",
"@base_images_docker//package_managers:install_pkgs.bzl",
_install = "install",
)
Expand Down
2 changes: 1 addition & 1 deletion tests/package_managers/test_complex_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ EOM
# Run download_pkgs and grab the resulting installables tar file
rm -f test_download_complex_pkgs.tar
bazel run //tests/package_managers:test_complex_download_pkgs
cp bazel-bin/tests/package_managers/test_complex_download_pkgs.runfiles/debian_docker/tests/package_managers/test_complex_download_pkgs.tar tests/package_managers
cp bazel-bin/tests/package_managers/test_complex_download_pkgs.runfiles/base_images_docker/tests/package_managers/test_complex_download_pkgs.tar tests/package_managers

# Add install_pkgs target to generated BUILD file
cat >> "$TEST_BUILD_FILE" <<- EOM
Expand Down
Binary file not shown.
Binary file not shown.
Binary file added ubuntu/18_0_4/builds/20180426/packages.tar
Binary file not shown.
2 changes: 1 addition & 1 deletion ubuntu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ genrule(

[bootstrap_image_macro(
name = "bootstrap_ubuntu_%s" % version,
date = "20180418",
date = "20180426",
image_tar = ":ubuntu_%s_vanilla.tar" % version,
output_image_name = "ubuntu_%s" % version,
packages = [
Expand Down
2 changes: 1 addition & 1 deletion util/config_stripper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

_TIMESTAMP = '1970-01-01T00:00:00Z'

WHITELISTED_PREFIXES = ['sha256:', 'manifest']
WHITELISTED_PREFIXES = ['sha256:', 'manifest', 'repositories']

def main():
parser = argparse.ArgumentParser()
Expand Down

0 comments on commit 0f8509d

Please sign in to comment.