Skip to content

Commit f4d03b5

Browse files
committed
chore: add oci_push delivery target example
1 parent 82e3166 commit f4d03b5

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

.aspect/workflows/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ tasks:
1212
always_deliver: true
1313
branches:
1414
- main
15+
- delivery_bwotb_test

.circleci/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ workflows:
1010
branches:
1111
only:
1212
- main
13+
- delivery_bwotb_test
1314
- aspect-build/test-delivery
1415
requires:
1516
- aw-test
@@ -398,6 +399,9 @@ jobs:
398399
- equal:
399400
- main
400401
- << pipeline.git.branch >>
402+
- equal:
403+
- delivery_bwotb_test
404+
- << pipeline.git.branch >>
401405
- equal:
402406
- aspect-build/test-delivery
403407
- << pipeline.git.branch >>

WORKSPACE

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,39 @@ fetch_terraform()
256256
load("//.aspect/workflows:deps.bzl", "fetch_workflows_deps")
257257

258258
fetch_workflows_deps()
259+
260+
http_archive(
261+
name = "rules_oci",
262+
sha256 = "58b7a175ee90c12583afeca388523adf6a4e5a0528f330b41c302b91a4d6fc06",
263+
strip_prefix = "rules_oci-1.6.0",
264+
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.6.0/rules_oci-v1.6.0.tar.gz",
265+
)
266+
267+
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
268+
269+
rules_oci_dependencies()
270+
271+
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")
272+
273+
oci_register_toolchains(
274+
name = "oci",
275+
crane_version = LATEST_CRANE_VERSION,
276+
)
277+
278+
load("@rules_oci//oci:pull.bzl", "oci_pull")
279+
280+
oci_pull(
281+
name = "debian",
282+
digest = "sha256:3d868b5eb908155f3784317b3dda2941df87bbbbaa4608f84881de66d9bb297b",
283+
image = "debian",
284+
platforms = [
285+
"linux/386",
286+
"linux/amd64",
287+
"linux/arm/v5",
288+
"linux/arm/v7",
289+
"linux/arm64/v8",
290+
"linux/mips64le",
291+
"linux/ppc64le",
292+
"linux/s390x",
293+
],
294+
)

release/BUILD.bazel

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2+
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")
23
load(":bazelisk_artifacts.bzl", "bazelisk_artifacts")
34
load(":cli_brew_artifacts.bzl", "cli_brew_artifacts")
45
load(":release.bzl", "multi_platform_binaries", "release")
@@ -103,3 +104,18 @@ sh_binary(
103104
],
104105
tags = ["deliverable"],
105106
)
107+
108+
oci_image(
109+
name = "image",
110+
base = "@debian",
111+
entrypoint = ["bash"],
112+
tars = [],
113+
visibility = ["//visibility:public"],
114+
)
115+
116+
oci_push(
117+
name = "push_image",
118+
image = ":image",
119+
repository = "111111111111.dkr.ecr.us-west-2.amazonaws.com/foo/bar",
120+
tags = ["deliverable"],
121+
)

0 commit comments

Comments
 (0)