Skip to content

Commit

Permalink
upgrade rules_oci to 2.x (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
kriscfoster authored Jan 2, 2025
1 parent 365a98d commit 8cea776
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ In this example, `rules_oci` is used to build and tag an image (`locally-built-i
...
oci_tarball(
oci_load(
name = "tarball",
image = ":java_image",
repo_tags = ["locally-built-image:1"],
Expand Down
6 changes: 3 additions & 3 deletions docker_compose_test/docker_compose_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@repo_absolute_path//:build_root.bzl", "BUILD_WORKSPACE_DIRECTORY")
load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")

common_tags = [
"docker", # these tests depend on docker
Expand Down Expand Up @@ -100,7 +100,7 @@ def go_docker_compose_test(
testonly = True,
)

oci_tarball(
oci_load(
name = docker_compose_test_container,
image = name + ".oci_image",
repo_tags = ["%s:%s" % (native.package_name(), docker_compose_test_container)],
Expand Down Expand Up @@ -198,7 +198,7 @@ def junit_docker_compose_test(
testonly = True,
)

oci_tarball(
oci_load(
name = docker_compose_test_container,
image = name.lower() + "_java_image",
repo_tags = ["%s:%s" % (native.package_name(), docker_compose_test_container)],
Expand Down
14 changes: 5 additions & 9 deletions examples/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ local_repository(

http_archive(
name = "rules_oci",
sha256 = "46ce9edcff4d3d7b3a550774b82396c0fa619cc9ce9da00c1b09a08b45ea5a14",
strip_prefix = "rules_oci-1.8.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.8.0/rules_oci-v1.8.0.tar.gz",
sha256 = "1bd16e455278d523f01326e0c3964cd64d7840a7e99cdd6e2617e59f698f3504",
strip_prefix = "rules_oci-2.2.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.2.0/rules_oci-v2.2.0.tar.gz",
)

RULES_JVM_EXTERNAL_TAG = "6.0"
Expand All @@ -40,12 +40,8 @@ http_archive(
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()

load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")

oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
)
load("@rules_oci//oci:repositories.bzl", "oci_register_toolchains")
oci_register_toolchains(name = "oci")

load("@rules_oci//oci:pull.bzl", "oci_pull")

Expand Down
4 changes: 2 additions & 2 deletions examples/locally-built-image-test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
load("@rules_docker_compose_test//docker_compose_test:docker_compose_test.bzl", "docker_compose_test")
load("@rules_pkg//:pkg.bzl", "pkg_tar")

Expand All @@ -31,7 +31,7 @@ oci_image(
],
)

oci_tarball(
oci_load(
name = "tarball",
image = ":java_image",
repo_tags = ["locally-built-image:2"],
Expand Down
6 changes: 3 additions & 3 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def rules_docker_compose_test_repositories():

http_archive(
name = "rules_oci",
sha256 = "46ce9edcff4d3d7b3a550774b82396c0fa619cc9ce9da00c1b09a08b45ea5a14",
strip_prefix = "rules_oci-1.8.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.8.0/rules_oci-v1.8.0.tar.gz",
sha256 = "1bd16e455278d523f01326e0c3964cd64d7840a7e99cdd6e2617e59f698f3504",
strip_prefix = "rules_oci-2.2.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.2.0/rules_oci-v2.2.0.tar.gz",
)

http_archive(
Expand Down

0 comments on commit 8cea776

Please sign in to comment.