Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ci/component/bazelisk
1 result
Show changes
Commits on Source (24)
# Enable `bzlmod`
common --enable_bzlmod
common --registry https://bcr.bazel.build
common --registry=https://gitlab.arm.com/bazel/rules_download/-/releases/v1.0.0-alpha.2/downloads
# Build cache
build --experimental_guard_against_concurrent_changes
......
......@@ -62,13 +62,14 @@ semantic-release:
- deploy
image: node:lts
cache:
key:
prefix: "node"
files:
- package-lock.json
paths:
- node_modules
- .cache/npm
- !reference [.bazelisk, cache]
- key:
prefix: "node"
files:
- package-lock.json
paths:
- node_modules
- .cache/npm
before_script:
- npm config --location project set cache "${CI_PROJECT_DIR}/.cache/npm"
- npm ci --prefer-offline
......
registry=https://gitlab.arm.com/api/v4/groups/semantic-release/-/packages/npm/
async function verifyConditions(pluginConfig, context) {
const { verifyConditions: shim } = await import("./tag.mjs");
return shim(pluginConfig, context);
}
async function prepare(pluginConfig, context) {
const { prepare: shim } = await import("./tag.mjs");
return shim(pluginConfig, context);
}
// eslint-disable-next-line unicorn/prefer-module
module.exports = {
verifyConditions,
prepare,
};
// TODO: replace this with `@semantic-release/yq`
import { readFile, writeFile } from "node:fs/promises";
import path from "node:path";
import SemanticReleaseError from "@semantic-release/error";
import debug from "debug";
debug("semantic-release:tag");
const FILEPATHS = Object.freeze(["templates/bazelisk.yml", "bazelisk/template.yml"]);
const REGEX = /(tag:\n\s+default: )(\S+)/m;
export async function verifyConditions(pluginConfig, context) {
const { filepaths = FILEPATHS, regex = REGEX } = pluginConfig;
const { cwd, logger } = context;
if (!Array.isArray(filepaths)) {
throw new SemanticReleaseError(
"`filepaths` must be an array",
"ETAGCFG",
`\`${filepaths}\` (\`${typeof filepaths}\`)`,
);
}
for (const filepath of filepaths) {
if (typeof filepath !== "string") {
throw new SemanticReleaseError(
"`filepath` must be a string",
"ETAGCFG",
`\`${filepath}\` (\`${typeof filepath}\`)`,
);
}
const template = path.join(cwd, filepath);
const data = await (async () => {
try {
debug("Reading `%s`", template);
return await readFile(template, { encoding: "utf8" });
} catch (error) {
throw new SemanticReleaseError(`Failed to read \`${template}\``, "ETAGREAD", `${error}`);
}
})();
debug("Finding `%s` in `%s`", regex, template);
if (!regex.test(data)) {
throw new SemanticReleaseError(`\`${template}\` \`${regex}\` does not exist`, "ETAGREGEX");
}
try {
debug("Writing `%s`", template);
await writeFile(template, data);
} catch (error) {
throw new SemanticReleaseError(`Failed to write \`${template}\``, "ETAGWRITE", `${error}`);
}
logger.success("Validated `%s`", template);
}
}
export async function prepare(pluginConfig, context) {
const { filepaths = FILEPATHS, regex = REGEX } = pluginConfig;
const {
cwd,
logger,
nextRelease: { version },
} = context;
for (const filepath of filepaths) {
const template = path.join(cwd, filepath);
debug("Reading `%s`", template);
const data = await readFile(template, { encoding: "utf8" });
debug("Setting `%s` in `%s`", regex, template);
const updated = data.replace(REGEX, (_, prefix, current) => {
logger.log("Replacing `%s` with `%s`", current, version);
return `${prefix}${version}`;
});
debug("Writing `%s`", template);
await writeFile(template, updated);
logger.success("Wrote `%s`", template);
}
}
......@@ -14,28 +14,47 @@ plugins:
publishCmd: >
npx bazelisk run --stamp --embed_label="${nextRelease.version}" -- //bazelisk/push:tagged
- "@semantic-release/bzlmod"
- "./.release/tag.js"
- path: "@semantic-release/yq"
assets:
- filepath: "templates/bazelisk.yml"
frontMatter: "process"
expression: |-
.spec.inputs.tag.default = "${nextRelease.version}"
- path: "@semantic-release/git"
assets:
- "MODULE.bazel"
- "CHANGELOG.md"
- "templates/bazelisk.yml"
- "bazelisk/template.yml"
- path: "@semantic-release/bzlmod"
source:
prefix: "${CI_PROJECT_NAME}-v${version}"
archive: "src.tar.gz"
url: "${CI_PROJECT_URL}/-/releases/v${version}/downloads/${CI_PROJECT_NAME}-v${version}.tar.gz"
archive: "${CI_PROJECT_NAME}-v${version}.tar.gz"
url: "${CI_PROJECT_URL}/-/releases/v${version}/downloads/src.tar.gz"
- path: "@semantic-release/gitlab"
assets:
- path: "MODULE.bazel"
type: "package"
- path: MODULE.bazel
label: MODULE.bazel
type: package
filepath: "/modules/${env.CI_PROJECT_NAME}/${nextRelease.version}/MODULE.bazel"
- path: "source.json"
type: "package"
target: generic_package
status: hidden
- path: source.json
label: source.json
type: package
filepath: "/modules/${env.CI_PROJECT_NAME}/${nextRelease.version}/source.json"
- path: "icon.svg"
type: "image"
- path: "src.tar.gz"
type: "package"
filepath: "/${env.CI_PROJECT_NAME}-v${nextRelease.version}.tar.gz"
target: generic_package
status: hidden
- path: icon.svg
type: image
- path: "${env.CI_PROJECT_NAME}-v${nextRelease.version}.tar.gz"
label: "${env.CI_PROJECT_NAME}-v${nextRelease.version}.tar.gz"
type: package
filepath: "/src.tar.gz"
target: generic_package
status: hidden
- path: metadata.json
label: metadata.json
type: package
filepath: "/modules/${env.CI_PROJECT_NAME}/metadata.json"
target: generic_package
status: hidden
......@@ -5,17 +5,25 @@ Source: https://gitlab.arm.com/bazel/oci
Files:
*.bazel
bazelisk/*.yaml
*/test/*.yaml
*.bzl
*.sh
Copyright: 2023 Arm Ltd.
templates/bazelisk.yml
Copyright: 2024 Arm Ltd.
License: MIT
Files:
.editorconfig
.gitlab-ci.yml
.gitignore
*/.gitignore
.bazelrc
*.md
Copyright: 2023 Arm Ltd.
CODEOWNERS
package.json
package-lock.json
.releaserc.yaml
.npmrc
Copyright: 2024 Arm Ltd.
License: CC0-1.0
# [1.0.0-beta.3](https://git.gitlab.arm.com/ci/component/bazelisk/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2024-02-26)
### Bug Fixes
- move run commands copying into `before_script` ([5f26233](https://git.gitlab.arm.com/ci/component/bazelisk/commit/5f26233b79ebb92d89cd66a99bdf85900e0752e8))
- remove `diff` ([eda49db](https://git.gitlab.arm.com/ci/component/bazelisk/commit/eda49dbb2d5758aed02a6e1cb6e0c3a6ca850af0))
- upgrade `bazelisk@1.19.0` ([9d32020](https://git.gitlab.arm.com/ci/component/bazelisk/commit/9d320206a322535ccd54a0ade4533b948fbc4985))
- upgrade to `linux-libc-dev@6.1.76` ([55c4635](https://git.gitlab.arm.com/ci/component/bazelisk/commit/55c463522383c05d9816bcc522bf9da15da53e97))
### chore
- remote GitLab 16.5 workaround ([16f27f9](https://git.gitlab.arm.com/ci/component/bazelisk/commit/16f27f9faeb130355babcb576adc592873c03be9))
### BREAKING CHANGES
- Template no longer supports GitLab less than 16.5
The `bazelisk/template.yml` file has been removed which was required
for the CI component to be picked up on the experimental implementation
in 16.4 and less.
- `diff` has been removed.
Use the hermetic [`rules_diff`][rules_diff] Bazel module.
[rules_diff]: https://registry.bazel.build/modules/rules_diff
# [1.0.0-beta.2](https://git.gitlab.arm.com/ci/component/bazelisk/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2024-01-04)
### Bug Fixes
......
* @bazel
[CI components] @matthew.clarkson
/templates/
[Documentation] @matthew.clarkson
*.md
[Licensing] @matthew.clarkson
/.reuse/dep5
/LICENSES/*
[Configuration] @matthew.clarkson
.editorconfig
[CI] @matthew.clarkson
.gitlab-ci.yml
[Release] @matthew.clarkson
/.releaserc.yaml
[Node] @matthew.clarkson
/package.json
/.npmrc
[Branding] @matthew.clarkson
/icon.svg
[Bazel] @matthew.clarkson
/.bazelrc
/.bazelrc.ci
/.bazelignore
/.bazelversion
*.bazel
*.bzl
WORKSPACE
module(
name = "bazelisk",
version = "1.0.0-beta.2",
version = "1.0.0-beta.3",
bazel_compatibility = [
">=6.4.0",
">=7.0.0",
],
)
bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "aspect_bazel_lib", version = "2.1.0")
bazel_dep(name = "platforms", version = "0.0.7")
bazel_dep(name = "rules_oci", version = "1.5.1")
bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.4.1")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_oci", version = "1.7.2")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "container_structure_test", version = "1.16.0")
bazel_dep(name = "rules_download", version = "1.0.0-alpha.2")
bazel_dep(name = "rules_python", version = "0.25.0")
bazel_dep(name = "download_utils", version = "1.0.0-beta.1")
bazel_dep(name = "rules_python", version = "0.31.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
......@@ -28,7 +28,7 @@ register_toolchains("//python:all")
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "distroless",
digest = "sha256:5a779e9c2635dbea68ae7988f398f95686ccde186cd2abf51207e41ed2ec51f4",
digest = "sha256:2102ce121ff1448316b93c5f347118a8e604f5ba7ec9dd7a5c2d8b0eac2941fe",
image = "gcr.io/distroless/base-debian12",
platforms = [
"linux/amd64",
......@@ -43,230 +43,66 @@ oci.pull(
)
use_repo(oci, "distroless")
download_file = use_repo_rule("@rules_download//download/file:defs.bzl", "download_file")
download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file")
download_deb = use_repo_rule("@rules_download//download/deb:defs.bzl", "download_deb")
download_deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb")
# Bazelisk
download_file(
name = "amd64-linux",
executable = True,
integrity = "sha256-zlLKpR755Qn7a35a2JLlzxD+sHlLCu1NLzatsAoaJ3k=",
output = "bazelisk",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64"],
)
download_file(
name = "arm64-linux",
executable = True,
integrity = "sha256-YHC/cJFekrOlzo7ub0qKCWi7NQviqYuAsP0vwTzoolQ=",
output = "bazelisk",
urls = ["https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-arm64"],
)
# Debian GCC runtime
download_deb(
name = "libgcc-amd64",
integrity = "sha256-89HUjAWZrqhbfyB3oB0oW63EKZjBoedHOTXVz5lcgUE=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/g/gcc-12/libgcc-s1_12.2.0-14_amd64.deb",
"http://ftp.no.debian.org/debian/pool/main/g/gcc-12/libgcc-s1_12.2.0-14_amd64.deb",
"http://ftp.us.debian.org/debian/pool/main/g/gcc-12/libgcc-s1_12.2.0-14_amd64.deb",
"http://ftp.cn.debian.org/debian/pool/main/g/gcc-12/libgcc-s1_12.2.0-14_amd64.deb",
],
)
download_deb(
name = "libgcc-arm64",
integrity = "sha256-b84iaNjzFSpOhGNPWiQTPTxikDsvmxG5xZI1y7wbI6g=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/g/gcc-12/libgcc-s1_12.2.0-14_arm64.deb",
"http://ftp.no.debian.org/debian/pool/main/g/gcc-12/libgcc-s1_12.2.0-14_arm64.deb",
"http://ftp.us.debian.org/debian/pool/main/g/gcc-12/libgcc-s1_12.2.0-14_arm64.deb",
"http://ftp.cn.debian.org/debian/pool/main/g/gcc-12/libgcc-s1_12.2.0-14_arm64.deb",
],
)
# Debian C++ runtime
download_deb(
name = "libstdcxx-amd64",
integrity = "sha256-mxsmkCDOxqztOznwlve2ft0fDUqyT0EstlBtCADhnL8=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/g/gcc-12/libstdc++6_12.2.0-14_amd64.deb",
"http://ftp.no.debian.org/debian/pool/main/g/gcc-12/libstdc++6_12.2.0-14_amd64.deb",
"http://ftp.us.debian.org/debian/pool/main/g/gcc-12/libstdc++6_12.2.0-14_amd64.deb",
"http://ftp.cn.debian.org/debian/pool/main/g/gcc-12/libstdc++6_12.2.0-14_amd64.deb",
],
)
download_deb(
name = "libstdcxx-arm64",
integrity = "sha256-IelxxdNQb3g7ie/o4SrIUIHd2SE+T2UpJivP6VwyZnA=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/g/gcc-12/libstdc++6_12.2.0-14_arm64.deb",
"http://ftp.no.debian.org/debian/pool/main/g/gcc-12/libstdc++6_12.2.0-14_arm64.deb",
"http://ftp.us.debian.org/debian/pool/main/g/gcc-12/libstdc++6_12.2.0-14_arm64.deb",
"http://ftp.cn.debian.org/debian/pool/main/g/gcc-12/libstdc++6_12.2.0-14_arm64.deb",
],
)
# Debian `zlib`
download_deb(
name = "libz-amd64",
integrity = "sha256-190dFBH+3yf14nZQpu/yDvKUB3tWj0yMXlFGbcfAjOQ=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_amd64.deb",
"http://ftp.no.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_amd64.deb",
"http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_amd64.deb",
"http://ftp.cn.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_amd64.deb",
],
)
download_deb(
name = "libz-arm64",
integrity = "sha256-Uri4oUW74ZVruoIDT3cCLL7ww9CIXJ4y2YF6eTL+GRM=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_arm64.deb",
"http://ftp.no.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_arm64.deb",
"http://ftp.us.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_arm64.deb",
"http://ftp.cn.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.13.dfsg-1_arm64.deb",
],
)
# Debian terminal info
download_deb(
name = "libtinfo-amd64",
integrity = "sha256-By2Qjzj1EJDKKMpa+jtGspV9xh/jUJTAuFFCaFmkmlE=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.4-4_amd64.deb",
"http://ftp.no.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.4-4_amd64.deb",
"http://ftp.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.4-4_amd64.deb",
"http://ftp.cn.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.4-4_amd64.deb",
],
)
download_deb(
name = "libtinfo-arm64",
integrity = "sha256-uu8PZ3b4TH7tTxFG1uV3RolWfa1DIWiU1B2gLmYI5LM=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.4-4_arm64.deb",
"http://ftp.no.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.4-4_arm64.deb",
"http://ftp.us.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.4-4_arm64.deb",
"http://ftp.cn.debian.org/debian/pool/main/n/ncurses/libtinfo6_6.4-4_arm64.deb",
],
)
# Debian Bourne Again Shell
download_deb(
name = "bash-amd64",
integrity = "sha256-UyXmOsrss39mNpkDKDcHdJlb2bPc4Qq9A2bIoGh3vQ0=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/b/bash/bash_5.2.15-2+b2_amd64.deb",
"http://ftp.no.debian.org/debian/pool/main/b/bash/bash_5.2.15-2+b2_amd64.deb",
"http://ftp.us.debian.org/debian/pool/main/b/bash/bash_5.2.15-2+b2_amd64.deb",
"http://ftp.cn.debian.org/debian/pool/main/b/bash/bash_5.2.15-2+b2_amd64.deb",
],
)
download_deb(
name = "bash-arm64",
integrity = "sha256-E8TnADCgWa7sa3ReTOKUnOZ0BSRrs4Uh5sj00hwTNUM=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/b/bash/bash_5.2.15-2+b2_arm64.deb",
"http://ftp.no.debian.org/debian/pool/main/b/bash/bash_5.2.15-2+b2_arm64.deb",
"http://ftp.us.debian.org/debian/pool/main/b/bash/bash_5.2.15-2+b2_arm64.deb",
"http://ftp.cn.debian.org/debian/pool/main/b/bash/bash_5.2.15-2+b2_arm64.deb",
],
)
# `toybox` for _most_ `coreutils`
download_deb(
name = "toybox-amd64",
integrity = "sha256-IFVmdArrwz0gzAYSeNqO5ES/pKk85iJShIUetm4THuU=",
urls = [
"http://ftp.us.debian.org/debian/pool/main/t/toybox/toybox_0.8.9+dfsg-1_amd64.deb",
"http://ftp.no.debian.org/debian/pool/main/t/toybox/toybox_0.8.9+dfsg-1_amd64.deb",
"http://ftp.us.debian.org/debian/pool/main/t/toybox/toybox_0.8.9+dfsg-1_amd64.deb",
"http://ftp.cn.debian.org/debian/pool/main/t/toybox/toybox_0.8.9+dfsg-1_amd64.deb",
],
)
download_deb(
name = "toybox-arm64",
integrity = "sha256-5CPfAArbm5SvgH1cQpemJeyIdnczTXLkoljfI/lhbXo=",
urls = [
"http://ftp.us.debian.org/debian/pool/main/t/toybox/toybox_0.8.9+dfsg-1_arm64.deb",
"http://ftp.no.debian.org/debian/pool/main/t/toybox/toybox_0.8.9+dfsg-1_arm64.deb",
"http://ftp.us.debian.org/debian/pool/main/t/toybox/toybox_0.8.9+dfsg-1_arm64.deb",
"http://ftp.cn.debian.org/debian/pool/main/t/toybox/toybox_0.8.9+dfsg-1_arm64.deb",
],
)
# `toybox` needs `libcrypt`
download_deb(
name = "libcrypt-amd64",
integrity = "sha256-9fYKXN/U5OqpQ4reUHild0Gnp41ln8sMcBIE9SPovSk=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.33-2_amd64.deb",
"http://ftp.no.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.33-2_amd64.deb",
"http://ftp.us.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.33-2_amd64.deb",
"http://ftp.cn.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.33-2_amd64.deb",
],
)
download_deb(
name = "libcrypt-arm64",
integrity = "sha256-7qCtdupetQcSf+oMKRYi6k7Nu3HEuajtnHauM/waASc=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.33-2_arm64.deb",
"http://ftp.no.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.33-2_arm64.deb",
"http://ftp.us.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.33-2_arm64.deb",
"http://ftp.cn.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.33-2_arm64.deb",
],
)
# `busybox` for any _other_ `coreutils` that `toybox` does not implement
download_deb(
name = "busybox-amd64",
integrity = "sha256-KqI9MBsqEgZPIju0AOeVNYuAgs6QsbmGKCGV5iFL+cg=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-6+b3_amd64.deb",
"http://ftp.no.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-6+b3_amd64.deb",
"http://ftp.us.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-6+b3_amd64.deb",
"http://ftp.cn.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-6+b3_amd64.deb",
],
)
download_deb(
name = "busybox-arm64",
integrity = "sha256-cYuJrSahQWw0TM3ZOSzw0AmR1DrgiFuHRnZ7O4W/yVo=",
urls = [
"http://ftp.uk.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-6+b3_arm64.deb",
"http://ftp.no.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-6+b3_arm64.deb",
"http://ftp.us.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-6+b3_arm64.deb",
"http://ftp.cn.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-6+b3_arm64.deb",
],
)
# /usr/include/linux/version.h
download_deb(
name = "linux-libc-dev-amd64",
integrity = "sha256-ZM1wtCXOkbjIXJEoTqMkbrYFQP0rQM1hVdaEaWjj6BA=",
urls = [
"http://ftp.us.debian.org/debian/pool/main/l/linux/linux-libc-dev_6.1.66-1_amd64.deb",
"http://ftp.no.debian.org/debian/pool/main/l/linux/linux-libc-dev_6.1.66-1_amd64.deb",
"http://ftp.us.debian.org/debian/pool/main/l/linux/linux-libc-dev_6.1.66-1_amd64.deb",
"http://ftp.cn.debian.org/debian/pool/main/l/linux/linux-libc-dev_6.1.66-1_amd64.deb",
],
)
download_deb(
name = "linux-libc-dev-arm64",
integrity = "sha256-CjbFtclfEUt4LN6Jyo3k/h9kx9o9OYHJMRG0fhwI2Tc=",
urls = [
"http://ftp.us.debian.org/debian/pool/main/l/linux/linux-libc-dev_6.1.66-1_arm64.deb",
"http://ftp.no.debian.org/debian/pool/main/l/linux/linux-libc-dev_6.1.66-1_arm64.deb",
"http://ftp.us.debian.org/debian/pool/main/l/linux/linux-libc-dev_6.1.66-1_arm64.deb",
"http://ftp.cn.debian.org/debian/pool/main/l/linux/linux-libc-dev_6.1.66-1_arm64.deb",
],
)
[
download_file(
name = "{}-{}".format(cpu, os),
executable = True,
integrity = integrity,
output = "bazelisk",
urls = [
"https://gitlab.arm.com/api/v4/projects/ci%2Fcomponent%2Fbazelisk/packages/generic/bazelisk/{}/bazelisk-{}-{}".format(version, os, cpu),
"https://github.com/bazelbuild/bazelisk/releases/download/v{}/bazelisk-{}-{}".format(version, os, cpu),
],
)
for cpu, os, version, integrity in (
("amd64", "linux", "1.19.0", "sha256-0otYisCRar1r8C3vtUM/bt33y6Nf+oCOq7ZaRKqyJvc="),
("arm64", "linux", "1.19.0", "sha256-hhoWupl5YT5wvT0vnZq147Wf55RxxXU6zcnEMatsnZQ="),
)
]
# Debian packages
[
download_deb(
name = "{}-{}".format(
name,
pkg.removesuffix(".deb").rsplit("_")[-1],
),
integrity = integrity,
urls = [
"https://gitlab.arm.com/api/v4/projects/ci%2Fcomponent%2Fbazelisk/packages/generic/{}/{}/{}".format(
pkg.split("/")[-1].split("_")[0],
pkg.split("/")[-1].split("_")[1].split("-")[0],
pkg.split("/")[-1],
),
"http://ftp.uk.debian.org/debian/pool/main/{}".format(pkg),
"http://ftp.no.debian.org/debian/pool/main/{}".format(pkg),
"http://ftp.us.debian.org/debian/pool/main/{}".format(pkg),
"http://ftp.cn.debian.org/debian/pool/main/{}".format(pkg),
],
)
for name, pkg, integrity in (
("libgcc", "g/gcc-12/libgcc-s1_12.2.0-14_amd64.deb", "sha256-89HUjAWZrqhbfyB3oB0oW63EKZjBoedHOTXVz5lcgUE="),
("libgcc", "g/gcc-12/libgcc-s1_12.2.0-14_arm64.deb", "sha256-b84iaNjzFSpOhGNPWiQTPTxikDsvmxG5xZI1y7wbI6g="),
("libstdcxx", "g/gcc-12/libstdc++6_12.2.0-14_amd64.deb", "sha256-mxsmkCDOxqztOznwlve2ft0fDUqyT0EstlBtCADhnL8="),
("libstdcxx", "g/gcc-12/libstdc++6_12.2.0-14_arm64.deb", "sha256-IelxxdNQb3g7ie/o4SrIUIHd2SE+T2UpJivP6VwyZnA="),
("libz", "z/zlib/zlib1g_1.2.13.dfsg-1_amd64.deb", "sha256-190dFBH+3yf14nZQpu/yDvKUB3tWj0yMXlFGbcfAjOQ="),
("libz", "z/zlib/zlib1g_1.2.13.dfsg-1_arm64.deb", "sha256-Uri4oUW74ZVruoIDT3cCLL7ww9CIXJ4y2YF6eTL+GRM="),
("libtinfo", "n/ncurses/libtinfo6_6.4-4_amd64.deb", "sha256-By2Qjzj1EJDKKMpa+jtGspV9xh/jUJTAuFFCaFmkmlE="),
("libtinfo", "n/ncurses/libtinfo6_6.4-4_arm64.deb", "sha256-uu8PZ3b4TH7tTxFG1uV3RolWfa1DIWiU1B2gLmYI5LM="),
("bash", "b/bash/bash_5.2.15-2+b2_amd64.deb", "sha256-UyXmOsrss39mNpkDKDcHdJlb2bPc4Qq9A2bIoGh3vQ0="),
("bash", "b/bash/bash_5.2.15-2+b2_arm64.deb", "sha256-E8TnADCgWa7sa3ReTOKUnOZ0BSRrs4Uh5sj00hwTNUM="),
("toybox", "t/toybox/toybox_0.8.9+dfsg-1_amd64.deb", "sha256-IFVmdArrwz0gzAYSeNqO5ES/pKk85iJShIUetm4THuU="),
("toybox", "t/toybox/toybox_0.8.9+dfsg-1_arm64.deb", "sha256-5CPfAArbm5SvgH1cQpemJeyIdnczTXLkoljfI/lhbXo="),
("libcrypt", "libx/libxcrypt/libcrypt1_4.4.33-2_amd64.deb", "sha256-9fYKXN/U5OqpQ4reUHild0Gnp41ln8sMcBIE9SPovSk="),
("libcrypt", "libx/libxcrypt/libcrypt1_4.4.33-2_arm64.deb", "sha256-7qCtdupetQcSf+oMKRYi6k7Nu3HEuajtnHauM/waASc="),
("busybox", "b/busybox/busybox_1.30.1-6+b3_amd64.deb", "sha256-KqI9MBsqEgZPIju0AOeVNYuAgs6QsbmGKCGV5iFL+cg="),
("busybox", "b/busybox/busybox_1.30.1-6+b3_arm64.deb", "sha256-cYuJrSahQWw0TM3ZOSzw0AmR1DrgiFuHRnZ7O4W/yVo="),
("linux-libc-dev", "l/linux/linux-libc-dev_6.1.76-1_amd64.deb", "sha256-P9oWa5oixe5qoD59c3sqWoTzDsi/wW2ODU9T5d6PZKA="),
("linux-libc-dev", "l/linux/linux-libc-dev_6.1.76-1_arm64.deb", "sha256-xox+52LMGqbjkMojr4MEioqAPF2aJ+ulqtOymDiXSFg="),
)
]
This diff is collapsed.
......@@ -68,6 +68,20 @@ include:
tag: latest
```
### OCI Local Usage
Assuming the current working directory is the root of the project to test, run the following:
```shell
$ podman run \
-v $PWD:/mnt/src \
-w /mnt/src \
--rm \
-it registry.gitlab.arm.com/ci/component/bazelisk:1.0.0-beta.2 \
/bin/sh
sh-5.2$ bazelisk test //...
```
## YAML References
The `.bazelisk` template provides a simple way to invoke `bazelisk` in a job.
......@@ -80,12 +94,17 @@ Commonly, this is used to customise the `script` section of a job but still re-u
```yaml
custom:
extends: .bazelisk
extends:
- .bazelisk
- .credentials
before_script:
- !reference [.bazelisk, before_script]
- !reference [.credentials, before_script]
script:
- !reference [.bazelisk-fragment, rc]
- bazelisk build //...
- bazelisk run //...
```
[package-registry]: https://gitlab.arm.com/ci/component/bazelisk/-/packages
[gitlab-ci-reference]: https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#reference-tags
[bazelisk-download]: https://github.com/bazelbuild/bazelisk#how-does-bazelisk-know-which-bazel-version-to-run
......@@ -43,10 +43,6 @@ TOOLS = (
# `rules_oci`
# TODO: `rules_coreutils` for `rules_oci`
"tr",
# `diff_test`
# TODO: `rules_delta`
"diff",
)
pkg_tar(
......
# TODO: delete this file once `gitlab.arm.com` is upgraded to 16.5+
spec:
inputs:
image:
default: registry.gitlab.arm.com/ci/component/bazelisk
tag:
default: 1.0.0-beta.2
stage:
default: test
src:
default: .bazelrc.ci
dst:
default: .bazelrc.user
bazelisk:
default: bazelisk
command:
default: test
target:
default: //...
root:
default: .
key:
default: "bazelisk-1"
variables:
default: |
CI_PROJECT_DIR
CI_PROJECT_ID
---
include:
- local: "/templates/bazelisk.yml"
inputs:
image: "$[[inputs.image]]"
tag: "$[[inputs.tag]]"
stage: "$[[inputs.stage]]"
src: "$[[inputs.src]]"
dst: "$[[inputs.dst]]"
bazelisk: "$[[inputs.bazelisk]]"
command: "$[[inputs.command]]"
target: "$[[inputs.target]]"
root: "$[[inputs.root]]"
key: "$[[inputs.key]]"
variables: "$[[inputs.variables]]"
......@@ -6,17 +6,17 @@
"": {
"devDependencies": {
"@bazel/bazelisk": "^1",
"@semantic-release/bzlmod": "https://gitlab.arm.com/semantic-release/bzlmod/-/releases/v1.0.1/downloads/package.tar.gz",
"@semantic-release/bzlmod": "^1",
"@semantic-release/changelog": "^6",
"@semantic-release/commit-analyzer": "^11",
"@semantic-release/config-gitlab-bzlmod": "https://gitlab.arm.com/semantic-release/config-gitlab-bzlmod/-/releases/v1.0.3/downloads/package.tar.gz",
"@semantic-release/config-release-channels": "https://gitlab.arm.com/semantic-release/config-release-channels/-/releases/v1.0.1/downloads/package.tar.gz",
"@semantic-release/config-gitlab-bzlmod": "^1",
"@semantic-release/config-release-channels": "^1",
"@semantic-release/error": "^4",
"@semantic-release/exec": "^6",
"@semantic-release/git": "^10",
"@semantic-release/gitlab": "^12",
"@semantic-release/gitlab": "^12.1",
"@semantic-release/release-notes-generator": "^12",
"debug": "^4",
"@semantic-release/yq": "^1.1",
"semantic-release": "^22"
}
},
......@@ -737,26 +737,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@semantic-release/github/node_modules/globby": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-14.0.0.tgz",
"integrity": "sha512-/1WM/LNHRAOH9lZta77uGbq0dAEQM+XjNesWwhlERDVenqothRbnzTrL3/LrIoEPPjeUHC3vrS6TwoyxeHs7MQ==",
"dev": true,
"dependencies": {
"@sindresorhus/merge-streams": "^1.0.0",
"fast-glob": "^3.3.2",
"ignore": "^5.2.4",
"path-type": "^5.0.0",
"slash": "^5.1.0",
"unicorn-magic": "^0.1.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@semantic-release/github/node_modules/indent-string": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz",
......@@ -769,30 +749,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@semantic-release/github/node_modules/path-type": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz",
"integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@semantic-release/github/node_modules/slash": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
"integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
"dev": true,
"engines": {
"node": ">=14.16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@semantic-release/github/node_modules/url-join": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz",
......@@ -803,9 +759,9 @@
}
},
"node_modules/@semantic-release/gitlab": {
"version": "12.0.6",
"resolved": "https://registry.npmjs.org/@semantic-release/gitlab/-/gitlab-12.0.6.tgz",
"integrity": "sha512-NjGq+6cA64bQIyAjFSxzXxUJCS94fAtw8QMQSvuUycqhbQqXvjTKuknm9fS327leZURqslDMMKwEMuj0cHy31g==",
"version": "12.1.1",
"resolved": "https://registry.npmjs.org/@semantic-release/gitlab/-/gitlab-12.1.1.tgz",
"integrity": "sha512-vM8mqMmegRJB4+9MJCYeCt5Gn4C2rpF0bNOzKOHq1IaI4FleIV5sss0fn55jVCuVVztTnoPQylnti5Tkdg3uaw==",
"dev": true,
"dependencies": {
"@semantic-release/error": "^4.0.0",
......@@ -815,7 +771,7 @@
"escape-string-regexp": "^5.0.0",
"form-data": "^4.0.0",
"fs-extra": "^11.0.0",
"globby": "^11.0.0",
"globby": "^14.0.0",
"got": "^13.0.0",
"hpagent": "^1.0.0",
"lodash-es": "^4.17.21",
......@@ -966,6 +922,46 @@
"semantic-release": ">=20.1.0"
}
},
"node_modules/@semantic-release/yq": {
"version": "1.1.0",
"resolved": "https://gitlab.arm.com/api/v4/projects/433/packages/npm/@semantic-release/yq/-/@semantic-release/yq-1.1.0.tgz",
"integrity": "sha1-XFQLIOYPsSgsp5nzkwAQIqRTff4=",
"dev": true,
"dependencies": {
"@semantic-release/error": "^3 || ^4",
"debug": "^4",
"execa": "^8||^7||^6",
"lodash-es": "^4",
"which": "^3||^4"
},
"peerDependencies": {
"semantic-release": ">=19"
}
},
"node_modules/@semantic-release/yq/node_modules/isexe": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
"integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==",
"dev": true,
"engines": {
"node": ">=16"
}
},
"node_modules/@semantic-release/yq/node_modules/which": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
"integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
"dev": true,
"dependencies": {
"isexe": "^3.1.1"
},
"bin": {
"node-which": "bin/which.js"
},
"engines": {
"node": "^16.13.0 || >=18.0.0"
}
},
"node_modules/@sindresorhus/is": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz",
......@@ -979,9 +975,9 @@
}
},
"node_modules/@sindresorhus/merge-streams": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-1.0.0.tgz",
"integrity": "sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz",
"integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==",
"dev": true,
"engines": {
"node": ">=18"
......@@ -1111,15 +1107,6 @@
"integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==",
"dev": true
},
"node_modules/array-union": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
......@@ -1877,20 +1864,32 @@
}
},
"node_modules/globby": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
"integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz",
"integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==",
"dev": true,
"dependencies": {
"array-union": "^2.1.0",
"dir-glob": "^3.0.1",
"fast-glob": "^3.2.9",
"ignore": "^5.2.0",
"merge2": "^1.4.1",
"slash": "^3.0.0"
"@sindresorhus/merge-streams": "^2.1.0",
"fast-glob": "^3.3.2",
"ignore": "^5.2.4",
"path-type": "^5.0.0",
"slash": "^5.1.0",
"unicorn-magic": "^0.1.0"
},
"engines": {
"node": ">=10"
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/globby/node_modules/path-type": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz",
"integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
......@@ -6428,12 +6427,15 @@
}
},
"node_modules/slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
"integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
"dev": true,
"engines": {
"node": ">=8"
"node": ">=14.16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/source-map": {
......
# TODO: anything added here must also be added in `bazelisk/template.yml` until `gitlab.arm.com` upgrades to 16.5+
spec:
inputs:
image:
default: registry.gitlab.arm.com/ci/component/bazelisk
tag:
default: 1.0.0-beta.2
default: 1.0.0-beta.3
stage:
default: test
src:
......@@ -74,8 +73,9 @@ spec:
paths:
- ".cache"
when: always
script:
before_script:
- !reference [.bazelisk-fragment, rc]
script:
- !reference [.bazelisk-fragment, execute]
after_script:
- !reference [.bazelisk-fragment, testlogs]
......