Skip to content
Closed
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
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:

jobs:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ bazel-rules_oci
bazel-testlogs

bin/ocitool-*

node_modules
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs
35 changes: 17 additions & 18 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@buildifier_prebuilt//:rules.bzl", "buildifier", "buildifier_test")
load("@gazelle//:def.bzl", "DEFAULT_LANGUAGES", "gazelle", "gazelle_binary")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//oci:toolchain.bzl", "oci_local_toolchain")

# gazelle:prefix github.com/DataDog/rules_oci
# gazelle:go_naming_convention go_default_library
# gazelle:lang go

oci_local_toolchain(
name = "oci_local_toolchain",
)

buildifier(
name = "buildifier",
exclude_patterns = ["./.git/*"],
lint_mode = "warn",
mode = "fix",
npm_link_all_packages(
name = "node_modules",
)

buildifier_test(
name = "buildifier_test",
exclude_patterns = ["./.git/*"],
lint_mode = "warn",
no_sandbox = True,
workspace = "//:WORKSPACE",
oci_local_toolchain(
name = "oci_local_toolchain",
)

gazelle(
name = "gazelle",
gazelle = ":default_gazelle_binary",
gazelle = ":gazelle-binary",
)

gazelle_binary(
name = "default_gazelle_binary",
name = "gazelle-binary",
languages = DEFAULT_LANGUAGES + [
"@bazel_skylib_gazelle_plugin//bzl",
],
Expand All @@ -54,3 +43,13 @@ write_source_files(
"bin/ocitool-linux-arm64": "//go/cmd/ocitool",
},
)

alias(
name = "format",
actual = "//tools/format",
)

exports_files(
["WORKSPACE"],
visibility = ["//visibility:public"],
)
Empty file modified LICENSE-3rdparty.csv
100755 → 100644
Empty file.
52 changes: 31 additions & 21 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,42 @@ module(
repo_name = "com_github_datadog_rules_oci",
)

bazel_dep(name = "aspect_rules_js", version = "2.1.2")
bazel_dep(name = "aspect_bazel_lib", version = "2.7.3")
bazel_dep(name = "aspect_rules_lint", version = "1.0.8")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "gazelle", version = "0.38.0")
bazel_dep(name = "rules_go", version = "0.47.1")
bazel_dep(name = "rules_nodejs", version = "6.3.2")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "stardoc", version = "0.6.2")

bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.6.1", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.22.5")
go_sdk.host()
go_sdk.download(
name = "go_sdk",
version = "1.22.5",
)
use_repo(go_sdk, "go_sdk")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_blakesmith_ar",
"com_github_containerd_containerd",
"com_github_containerd_containerd_api",
"com_github_containerd_continuity",
"com_github_containerd_errdefs",
"com_github_containerd_fifo",
"com_github_containerd_log",
"com_github_containerd_platforms",
"com_github_containerd_typeurl_v2",
"com_github_docker_docker_credential_helpers",
"com_github_klauspost_compress",
"com_github_microsoft_go_winio",
"com_github_microsoft_hcsshim",
"com_github_mitchellh_go_homedir",
"com_github_moby_sys_sequential",
"com_github_opencontainers_go_digest",
"com_github_opencontainers_image_spec",
"com_github_opencontainers_runtime_spec",
"com_github_sirupsen_logrus",
"com_github_stretchr_testify",
"com_github_urfave_cli_v2",
"land_oras_oras_go",
"org_golang_google_grpc",
"org_golang_x_sync",
"org_golang_x_sys",
)
go_deps.module_override(
patch_strip = 1,
Expand All @@ -55,16 +48,33 @@ go_deps.module_override(
path = "github.com/containerd/containerd",
)

oci_pull = use_repo_rule("//oci:defs.bzl", "oci_pull")
oci_pull = use_repo_rule("//oci:repositories.bzl", "oci_pull")

oci_pull(
name = "ubuntu_focal",
# Latest at "focal" tag
digest = "sha256:9d6a8699fb5c9c39cf08a0871bd6219f0400981c570894cd8cbea30d3424a31f",
registry = "ghcr.io",
repository = "datadog/rules_oci/ubuntu",
name = "ubuntu_noble",
# "noble" tag as of 2024-12-30
digest = "sha256:80dd3c3b9c6cecb9f1667e9290b3bc61b78c2678c02cbdae5f0fea92cc6734ab",
registry = "mirror.gcr.io",
repository = "library/ubuntu",
)

register_toolchains(
"@com_github_datadog_rules_oci//:oci_local_toolchain",
)

node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(node_version = "16.14.2")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")

# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir $PWD install
use_repo(pnpm, "pnpm")
Loading