Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add oci_push delivery target example #610

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .aspect/workflows/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ tasks:
- test:
- delivery:
always_deliver: true
bazel:
flags:
- --remote_download_outputs=toplevel
branches:
- main
- delivery_bwotb_test
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ workflows:
branches:
only:
- main
- delivery_bwotb_test
- aspect-build/test-delivery
requires:
- aw-test
Expand Down Expand Up @@ -398,6 +399,9 @@ jobs:
- equal:
- main
- << pipeline.git.branch >>
- equal:
- delivery_bwotb_test
- << pipeline.git.branch >>
- equal:
- aspect-build/test-delivery
- << pipeline.git.branch >>
Expand Down
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"],
)
Loading