Skip to content

Commit

Permalink
chore: add oci_push delivery target example
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Jan 25, 2024
1 parent 82e3166 commit 8c73b85
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions .aspect/workflows/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ tasks:
always_deliver: true
branches:
- main
- delivery_bwotb_test
36 changes: 36 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,39 @@ fetch_terraform()
load("//.aspect/workflows:deps.bzl", "fetch_workflows_deps")

fetch_workflows_deps()

http_archive(
name = "rules_oci",
sha256 = "58b7a175ee90c12583afeca388523adf6a4e5a0528f330b41c302b91a4d6fc06",
strip_prefix = "rules_oci-1.6.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.6.0/rules_oci-v1.6.0.tar.gz",
)

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:pull.bzl", "oci_pull")

oci_pull(
name = "debian",
digest = "sha256:3d868b5eb908155f3784317b3dda2941df87bbbbaa4608f84881de66d9bb297b",
image = "debian",
platforms = [
"linux/386",
"linux/amd64",
"linux/arm/v5",
"linux/arm/v7",
"linux/arm64/v8",
"linux/mips64le",
"linux/ppc64le",
"linux/s390x",
],
)
16 changes: 16 additions & 0 deletions release/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")
load(":bazelisk_artifacts.bzl", "bazelisk_artifacts")
load(":cli_brew_artifacts.bzl", "cli_brew_artifacts")
load(":release.bzl", "multi_platform_binaries", "release")
Expand Down Expand Up @@ -103,3 +104,18 @@ sh_binary(
],
tags = ["deliverable"],
)

oci_image(
name = "image",
base = "@debian",
entrypoint = ["bash"],
tars = [],
visibility = ["//visibility:public"],
)

oci_push(
name = "push_image",
image = ":image",
repository = "111111111111.dkr.ecr.us-west-2.amazonaws.com/foo/bar",
tags = ["deliverable"],
)

0 comments on commit 8c73b85

Please sign in to comment.