This is the multi-page printable view of this section. Click here to print.
Release
Release rules
- 1: Bzl
- 1.1: al_release
- 1.2: al_release_binary
- 1.3: al_release_deployment
- 1.4: al_release_deployment_info
- 1.5: al_release_deps
- 1.6: al_release_files
- 1.7: al_release_files_info
- 1.8: al_release_info
- 2: Proto
- 2.1: contracts
1 - Bzl
Bazel bindings for the release tool
1.1 - al_release
al_release
load("@com_alwaldend_src//tools/release/main/bzl:al_release.bzl", "al_release")
al_release(name, srcs, git_bundle, git_state, manifest, project, release_name, release_tool,
root_prefix)
Rule describing a release
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| srcs | Sources | List of labels | optional | [] |
| git_bundle | Deterministic Git bundle used to generate release metadata | Label | optional | "@com_alwaldend_src_tools_git//:release_git_state" |
| git_state | Additional declared Git state used to generate release metadata | List of labels | optional | [] |
| manifest | Load manifest from a file instead of generating it from srcs | Label | optional | None |
| project | Project package_name | String | required | |
| release_name | Release name | String | required | |
| release_tool | Release tool | Label | optional | "@com_alwaldend_src//tools/release/main/go" |
| root_prefix | Root prefix | String | optional | "content/docs" |
1.2 - al_release_binary
al_release_binary
load("@com_alwaldend_src//tools/release/main/bzl:al_release_binary.bzl", "al_release_binary")
al_release_binary(name, srcs, arguments, cmd, oras, release_tool)
Release binary
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| srcs | Releases | List of labels | optional | [] |
| arguments | Arguments | List of strings | optional | [] |
| cmd | Cmd | String | optional | "deploy" |
| oras | Oras binary | Label | optional | "@com_alwaldend_src//tools/oras" |
| release_tool | Release tool | Label | optional | "@com_alwaldend_src//tools/release/main/go" |
1.3 - al_release_deployment
al_release_deployment
load("@com_alwaldend_src//tools/release/main/bzl:al_release_deployment.bzl", "al_release_deployment")
al_release_deployment(name, oci_repository)
Deployment info
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| oci_repository | OCI repository url | String | optional | "" |
1.4 - al_release_deployment_info
AlReleaseDeploymentInfo
load("@com_alwaldend_src//tools/release/main/bzl:al_release_deployment_info.bzl", "AlReleaseDeploymentInfo")
AlReleaseDeploymentInfo(info, info_file)
Deployment info
FIELDS
| Name | Description |
|---|---|
| info | Deployment info struct |
| info_file | Deployment info file |
1.5 - al_release_deps
al_release_deps
load("@com_alwaldend_src//tools/release/main/bzl:al_release_deps.bzl", "al_release_deps")
al_release_deps(name, srcs, visibility, **kwargs)
Generate a dependency diagram using genquery
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| name | name | none |
| srcs | list of labels to generate deps for (should be full labels) | none |
| visibility | visibility | None |
| kwargs | kwargs for al_release_files | none |
1.6 - al_release_files
al_release_files
load("@com_alwaldend_src//tools/release/main/bzl:al_release_files.bzl", "al_release_files")
al_release_files(name, deps, srcs, deployments, ignore_suffixes, release_tool)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Deps | List of labels | optional | [] |
| srcs | Sources | List of labels | optional | [] |
| deployments | Deployment info | List of labels | optional | [] |
| ignore_suffixes | Ignore src files ending with these suffixes | List of strings | optional | [] |
| release_tool | Release tool | Label | optional | "@com_alwaldend_src//tools/release/main/go" |
1.7 - al_release_files_info
AlReleaseFilesInfo
load("@com_alwaldend_src//tools/release/main/bzl:al_release_files_info.bzl", "AlReleaseFilesInfo")
AlReleaseFilesInfo(files, manifest)
Release files
FIELDS
| Name | Description |
|---|---|
| files | File dict, keys are filenames, values are Files |
| manifest | Release manifest for srcs |
1.8 - al_release_info
AlReleaseInfo
load("@com_alwaldend_src//tools/release/main/bzl:al_release_info.bzl", "AlReleaseInfo")
AlReleaseInfo(release_name, project, files, manifest)
Release information
FIELDS
| Name | Description |
|---|---|
| release_name | Release name (string) |
| project | Project subdir (string) |
| files | File dict, keys are filenames, values are Files |
| manifest | Release manifest (File) |
2 - Proto
Protobuf contracts
2.1 - contracts
Proto docs for contracts.proto
Java
load("@rules_java//java:defs.bzl", "java_library")
java_library(
name = "name",
deps = [
"@com_alwaldend_src//tools/release/main/proto/contracts:contracts_java_library",
],
)
Golang
load("@rules_go//go:def.bzl", "go_library")
go_library(
name = "name",
deps = [
"@com_alwaldend_src//tools/release/main/proto/contracts:contracts",
],
)
Proto
syntax = "proto3";
package release;
import "tools/git/main/proto/contracts/contracts.proto";
option go_package = "git.alwaldend.com/alwaldend/src/tools/release/main/proto/contracts";
message ReleaseHash {
string algo = 1;
string content = 2;
}
message ReleaseFile {
repeated ReleaseHash hashes = 1;
string name = 2;
string safe_name = 6;
string url = 3;
int64 size = 4;
string local_path = 5;
}
message ReleaseItem {
ReleaseFile file = 1;
repeated ReleaseDeployment deployments = 2;
}
message Project {
string subdir = 1;
string safe_subdir = 2;
}
message Git {
git.GitCommit revision = 1;
repeated git.GitCommit commits = 2;
}
message ReleasePageSectionItemAttr {
string name = 1;
string content = 2;
}
message ReleasePageSectionItem {
string content = 1;
string content_url = 2;
repeated ReleasePageSectionItemAttr attrs = 3;
}
message ReleasePageSection {
string title = 1;
repeated ReleasePageSectionItem items = 2;
}
message ReleasePage {
repeated ReleasePageSection sections = 1;
}
message ReleaseDeploymentOci {
string repository = 1;
repeated string tags = 2;
}
message ReleaseDeployment {
ReleaseDeploymentOci oci = 1;
}
message Release {
repeated ReleaseItem items = 1;
string name = 2;
Project project = 3;
Git git = 4;
}