Skip to content

Commit

Permalink
chore: rename example to examples
Browse files Browse the repository at this point in the history
This makes more sense since there are many examples
  • Loading branch information
alexeagle committed Feb 23, 2023
1 parent 16f1829 commit b67b586
Show file tree
Hide file tree
Showing 24 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ jobs:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...
- name: bazel build //example/... & run with a container runtime
- name: bazel build //examples/... & run with a container runtime
env:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
DOCKER_BIN: "${{ matrix.os == 'macos-latest' && 'podman' || 'docker' }}"
run: |
bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc build //example/js:tarball
$DOCKER_BIN load --input $(bazel cquery --output=files //example/js:tarball)
$DOCKER_BIN run --rm example/js:latest
bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc build //examples/js:tarball
$DOCKER_BIN load --input $(bazel cquery --output=files //examples/js:tarball)
$DOCKER_BIN run --rm examples/js:latest
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gazelle_binary(
languages = ["@bazel_skylib//gazelle/bzl"],
)

# gazelle:exclude example/**
# gazelle:exclude examples/**
gazelle(
name = "gazelle",
gazelle = "gazelle_bin",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ copy the WORKSPACE snippet into your `WORKSPACE` file.

## Usage

See the API documentation in the [docs](docs/) folder and the example usage in the [example](example/) folder.
See the API documentation in the [docs](docs/) folder and the example usage in the [examples](examples/) folder.
Note that the example relies on the setup code in the `/WORKSPACE` file in the root of this repo.
2 changes: 1 addition & 1 deletion example/BUILD.bazel → examples/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package(default_visibility = ["//example:__subpackages__"])
package(default_visibility = ["//examples:__subpackages__"])

platform(
name = "linux_arm64",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ oci_image(
"@platforms//cpu:arm64": "arm64",
"@platforms//cpu:x86_64": "amd64",
}),
base = "//example:base",
base = "//examples:base",
cmd = ["test.sh"],
env = {
"ENV1": "$PATH:/test",
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions example/js/BUILD.bazel → examples/js/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ js_image_layer(
name = "layers",
binary = ":main",
platform = select({
"@platforms//cpu:arm64": "//example:linux_arm64",
"@platforms//cpu:x86_64": "//example:linux_amd64",
"@platforms//cpu:arm64": "//examples:linux_arm64",
"@platforms//cpu:x86_64": "//examples:linux_amd64",
}),
)

Expand All @@ -22,8 +22,8 @@ oci_image(
"@platforms//cpu:arm64": "arm64",
"@platforms//cpu:x86_64": "amd64",
}),
base = "//example:base",
cmd = ["/example/js/main.sh"],
base = "//examples:base",
cmd = ["/examples/js/main.sh"],
entrypoint = ["bash"],
os = "linux",
tars = [":layers/app.tar"],
Expand All @@ -38,5 +38,5 @@ structure_test(
oci_tarball(
name = "tarball",
image = ":image",
repotags = ["example/js:latest"],
repotags = ["examples/js:latest"],
)
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion example/js/test.yaml → examples/js/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ commandTests:
expectedOutput: ["hello"]
- name: "version"
command: "bash"
args: ["/example/js/main.sh"]
args: ["/examples/js/main.sh"]
expectedOutput: ["Hello, this is rules_oci", "Node version: v16.15.0"]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ oci_image(
"@platforms//cpu:arm64": "arm64",
"@platforms//cpu:x86_64": "amd64",
}),
base = "//example:base",
base = "//examples:base",
cmd = ["test.bash"],
entrypoint = ["bash"],
os = "linux",
Expand All @@ -24,8 +24,8 @@ multi_arch(
name = "images",
image = ":image",
platforms = [
"//example:linux_arm64",
"//example:linux_amd64",
"//examples:linux_arm64",
"//examples:linux_amd64",
],
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion example/sign/BUILD.bazel → examples/sign/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ oci_image(
"@platforms//cpu:arm64": "arm64",
"@platforms//cpu:x86_64": "amd64",
}),
base = "//example:base",
base = "//examples:base",
cmd = ["app.bash"],
os = "linux",
tars = [":app.tar"],
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit b67b586

Please sign in to comment.