From 872a7190105542cfc9958039cd18f1b733e0dd0d Mon Sep 17 00:00:00 2001 From: Travis Cline Date: Sun, 19 May 2019 12:31:00 -0500 Subject: [PATCH] helm: tidy BUILD files, move rules to helm subdirectory --- BUILD | 28 -------------------------- Makefile | 4 ++-- README.md | 4 ++-- WORKSPACE | 2 +- docs/BUILD | 20 ++++++++++++++++++ docs.md => docs/docs.md | 0 helm/BUILD | 1 + helm.bzl => helm/helm.bzl | 2 -- buildifier.bzl => tools/buildifier.bzl | 0 9 files changed, 26 insertions(+), 35 deletions(-) create mode 100644 docs/BUILD rename docs.md => docs/docs.md (100%) create mode 100644 helm/BUILD rename helm.bzl => helm/helm.bzl (97%) rename buildifier.bzl => tools/buildifier.bzl (100%) diff --git a/BUILD b/BUILD index aa2b208..4b77b31 100644 --- a/BUILD +++ b/BUILD @@ -24,31 +24,3 @@ sh_test( ".dummy_test.sh", ], ) - -load("@io_bazel_skydoc//stardoc:stardoc.bzl", "stardoc") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -# package(default_visibility = ["//visibility:public"]) -package(default_visibility = ["//visibility:public"]) - -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") - -bzl_library( - - name = "skylib_paths", - srcs = ["@bazel_skylib//lib:paths.bzl"], -) -# bzl_library( -# name = "bazel_tools_pkg", -# srcs = ["@bazel_tools//tools:srcs"], -# ) - -stardoc( - name = "docs", - out = "docs.md", - input = "helm.bzl", - deps = [ - ":skylib_paths", - # ":bazel_tools_pkg", - ], -) diff --git a/Makefile b/Makefile index c9568f2..572fac9 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,8 @@ all: docs ci .PHONY: docs docs: deps - bazel build //:docs && cp bazel-bin/docs.md . - @chmod +w docs.md + bazel build //docs && cp bazel-bin/docs/docs.md docs + @chmod +w docs/docs.md .PHONY: deps ifeq ($(UNAME),Darwin) diff --git a/README.md b/README.md index 2f34efa..7ca5a2e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This allows you to describe Kubernetes applications in a deterministic manner. ## Documentation -* See [Rule and macro defintions](./docs.md) for macro documentation. +* See [Rule and macro defintions](./docs/docs.md) for macro documentation. ### API @@ -24,7 +24,7 @@ In your Bazel `WORKSPACE` file add this repository as a dependency: ``` git_repository( name = "com_github_tmc_rules_helm", - tag = "0.1.0", + tag = "0.2.0", remote = "https://github.com/tmc/rules_helm.git", ) ``` diff --git a/WORKSPACE b/WORKSPACE index 9adbfb5..6694004 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,7 +4,7 @@ load(":repos.bzl", "helm_repositories") helm_repositories() -load(":buildifier.bzl", "buildifier_repositories") +load("//tools:buildifier.bzl", "buildifier_repositories") buildifier_repositories() # Start stardoc rules diff --git a/docs/BUILD b/docs/BUILD new file mode 100644 index 0000000..cf21f10 --- /dev/null +++ b/docs/BUILD @@ -0,0 +1,20 @@ +load("@io_bazel_skydoc//stardoc:stardoc.bzl", "stardoc") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +package(default_visibility = ["//visibility:public"]) + +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") + +bzl_library( + name = "skylib_paths", + srcs = ["@bazel_skylib//lib:paths.bzl"], +) + +stardoc( + name = "docs", + out = "docs.md", + input = "//helm:helm.bzl", + deps = [ + ":skylib_paths", + ], +) diff --git a/docs.md b/docs/docs.md similarity index 100% rename from docs.md rename to docs/docs.md diff --git a/helm/BUILD b/helm/BUILD new file mode 100644 index 0000000..b89850e --- /dev/null +++ b/helm/BUILD @@ -0,0 +1 @@ +exports_files(["helm.bzl"]) diff --git a/helm.bzl b/helm/helm.bzl similarity index 97% rename from helm.bzl rename to helm/helm.bzl index 79506bf..ba4d404 100644 --- a/helm.bzl +++ b/helm/helm.bzl @@ -20,8 +20,6 @@ def helm_chart(name, srcs, update_deps = False): srcs: Source files to include as the helm chart. Typically this will just be glob(["**"]). update_deps: Whether or not to run a helm dependency update prior to packaging. """ - format: The format to write the Rat check report in. - visibility: The visibility of this rule. filegroup_name = name + "_filegroup" helm_cmd_name = name + "_package.sh" package_flags = "" diff --git a/buildifier.bzl b/tools/buildifier.bzl similarity index 100% rename from buildifier.bzl rename to tools/buildifier.bzl