From 28c93c490bfdbb9b0372e0a5e287827cabc614db Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Tue, 26 Nov 2024 22:23:19 -0500 Subject: [PATCH 01/16] feat: New v0.9.0 feature blog post --- src/content/docs/blog/v0_9_0-release.mdx | 41 ++++++++++++++++++++++++ src/content/docs/reference/stages.mdx | 4 --- 2 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 src/content/docs/blog/v0_9_0-release.mdx diff --git a/src/content/docs/blog/v0_9_0-release.mdx b/src/content/docs/blog/v0_9_0-release.mdx new file mode 100644 index 0000000..31da02a --- /dev/null +++ b/src/content/docs/blog/v0_9_0-release.mdx @@ -0,0 +1,41 @@ +--- +title: Release of v0.9.0 +description: Brand new features to make building your images easier! +date: 2024-11-26 +authors: + - name: Gerald (Jerry) Pinder + img: https://avatars.githubusercontent.com/u/4626052 + github: gmpinder +--- +:::tip[TLDR] +The BlueBuild CLI `v0.9.0` update introduces new features and breaking changes. [What do I need to do to migrate?](#breaking_changes) +::: + +# Features + +- Generate ISOs for a fresh install +- New `init` command for creating a new BlueBuild project +- Stages for compiling your favorite programs while keeping dev tools out of your image +- Copy module for copying programs from stages into your final image +- A new `switch` command consolidates `upgrade`/`rebase` commands +- A new `login` command for logging into registries for all tools like `docker`, `skopeo`, `cosign`, etc. +- A new `validate` command and check before building that will tell you where you have errors in your recipes +- A new `prune` command to easily clean build space for the build drivers +- The `sigstore` driver that can handle signing if you don't have `cosign` installed +- The ability to build multiple recipes at the same time + +# Breaking Changes + +- Local modules must now have the `source` property set to `local` + +```yaml +modules: + - type: custom-module + source: local + input: + - value 1 + - value 2 +``` + +- Removal of `yq` and the `get_yaml_array` bash function from the build in favor of `jq` and the new `get_json_array` +- Minimum supported version of `buildah` is now `1.29` up from `1.24` diff --git a/src/content/docs/reference/stages.mdx b/src/content/docs/reference/stages.mdx index c4b779b..67fcca7 100644 --- a/src/content/docs/reference/stages.mdx +++ b/src/content/docs/reference/stages.mdx @@ -3,10 +3,6 @@ title: Stages description: A stage is a separate image build flow executed in parallel with the main build. --- -:::note -This feature is experimental and currently only available when using `use_unstable_cli` option in the [GitHub Action](/reference/github-action/) or using the `stages` feature when compiling. -::: - This property will allow users to define a list of Containerfile stages each with their own modules. Stages can be used to compile programs, perform parallel operations, and copy the results into the final image without contaminating the final image. ## Module Support From d86a1fc2a6ac0ca969f6e81091f7762ce3e3174b Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 17:16:00 +0200 Subject: [PATCH 02/16] chore: change way date is displayed in blog sidebar --- src/components/Sidebar.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Sidebar.astro b/src/components/Sidebar.astro index 0da31f9..14cb95b 100644 --- a/src/components/Sidebar.astro +++ b/src/components/Sidebar.astro @@ -19,7 +19,7 @@ const sidebarPostList: StarlightRouteData["sidebar"] = blogPosts badge: undefined, href: url, isCurrent: Astro.url.pathname.includes(url || ""), - label: ` ${p.frontmatter.title} – ${new Date(p.frontmatter.date).toISOString().substring(0, 10)}`, + label: ` ${p.frontmatter.title} (${new Date(p.frontmatter.date).toISOString().substring(0, 10)})`, type: "link", } as SidebarEntry; }); From 7856bc2a3d42157dd02d261f64cb1be05508fa32 Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 18:41:39 +0200 Subject: [PATCH 03/16] feat: finish blog post --- .../docs/blog/v090-features-changes.mdx | 125 ++++++++++++++++++ src/content/docs/blog/v0_9_0-release.mdx | 41 ------ 2 files changed, 125 insertions(+), 41 deletions(-) create mode 100644 src/content/docs/blog/v090-features-changes.mdx delete mode 100644 src/content/docs/blog/v0_9_0-release.mdx diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx new file mode 100644 index 0000000..6b89076 --- /dev/null +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -0,0 +1,125 @@ +--- +title: New CLI Features & Breaking Changes — v0.9.0 +description: Brand new features to make building your images easier! +date: 2024-12-02 +authors: + - name: Gerald (Jerry) Pinder + img: https://avatars.githubusercontent.com/u/4626052 + github: gmpinder + - name: xyny + img: https://avatars.githubusercontent.com/u/60004820 + github: xynydev +--- + +:::caution[TLDR] +The BlueBuild CLI `v0.9.0` update introduces **breaking changes**. [Show me what you broke!](#breaking-changes) +::: + +The BlueBuild CLI is the tool that builds all BlueBuild custom images. It is also installed on every image built with BlueBuild and can be used to build and tinker with images locally. Lately we _(gmpinder)_ been hard at work on a new CLI version to automate many administrative tasks you have to do as a custom image creator. But enough of the fluff, let's get right to it! + +## New Features + +### Generate ISOs for a fresh install + +You can now generate offline ISO installation images as shown in the [how to -guide](/how-to/generate-iso/). Under the hood this is a wrapper of [JasonN3's build-container-installer](https://github.com/JasonN3/build-container-installer). Feel free to report issues to the CLI repository first, and to the upstream project only if the issue is deemed to be caused by them. + +### Quickly start a new BlueBuild project from the command line + +You can now use the `bluebuild new` and `bluebuild init` commands to start a new BlueBuild project from the command line. This will set up a new local git repository for you based on the [template](https://github.com/blue-build/template/) and some short configuration questions. (`new` creates a project in a new directory, `init` in the current empty one) + +Here's a sneak peek: + +```bash +❯ bluebuild new ./weird-os +✔ What would you like to name your image? · weird-os +✔ What is the registry for the image? (e.g. ghcr.io or registry.gitlab.com) · ghcr.io +✔ What is the name of your org/username? · octocat +✔ Write a short description of your image: · this is my weird custom OS :3 +✔ Are you building on Github or Gitlab? · Github +Private key written to cosign.key +Public key written to cosign.pub +[main (root-commit) 994d18c] chore: Initial Commit + 11 files changed, 355 insertions(+) + create mode 100644 .github/dependabot.yml + create mode 100644 .github/workflows/build.yml + create mode 100644 .gitignore + create mode 100644 LICENSE + create mode 100644 README.md + create mode 100644 cosign.pub + create mode 100644 files/scripts/example.sh + create mode 100644 files/system/etc/.gitkeep + create mode 100644 files/system/usr/.gitkeep + create mode 100644 modules/.gitkeep + create mode 100644 recipes/recipe.yml +INFO => Created new BlueBuild project in ./weird-os +``` + +### Build stages for compiling programs from source while keeping your image clean + +You can define stages with a new top-level `stages:` key in the recipe before the `modules:`. Stages use the same module ssystem as the rest of the build, but you'll probably find the [`script`](/reference/modules/script/) module most useful. + +After building something in a stage, you can use the newly stable [`copy`](/reference/modules/copy/) module to copy files from the stage. This maps directly to a `COPY` statement in the `Containerfile`. + +Read more on the [dedicated Stages-page](https://blue-build.org/reference/stages/). + +### Miscellaneous + +- A new `login` command for logging into registries for all tools like `docker`, `skopeo`, `cosign`, etc. +- A new `validate` command and check before building that will tell you where you have errors in your recipes +- A new `prune` command to easily clean build space for the build drivers +- The `sigstore` driver can now handle signing if you don't have `cosign` installed +- A new `switch` command consolidates `upgrade`/`rebase` commands +- The ability to build multiple recipes at the same time + +## Breaking Changes + +### Related to custom modules + +Internal changes and refactors always might affect your custom modules, but we try to be transparent when making such changes and announce them, so that you aren't left with broken builds without any apparent reason. + +#### Removal of [`yq`](https://github.com/mikefarah/yq) + +We no longer include `yq` by default in images built with BlueBuild, and have refactored all modules to use `jq` instead. This comes in tandem with our experimentation with using Nushell to build some new modules, and a concern of `yq` being included unconditionally regardless of it is actually needed in an image, increasing attack surface. Read more about this from the [related GitHub issue](https://github.com/blue-build/cli/issues/261). + +What this means for you: + +- Reading module configuration with `yq` and `get_yaml_array` will break with the new update +- You now have to use `jq` and `get_json_array` instead + +Here's how you should refactor your module code: + +```diff lang=bash +#!/usr/bin/env bash + +# read a single variable from the configuration +- VAR=$(echo "$1" | yq -I=0 '.var') ++ VAR=$(echo "$1" | jq -r 'try .["var"]') +echo "$VAR" + +# read an array from the configuration +- get_yaml_array ARRAY '.array[]' "$1" ++ get_json_array ARRAY '.["array"][]' "$1" +``` + +#### New way to use a local modules + +Local modules must now have the `source` property set to `local`. Local modules are those that live inside the same repository as your custom image, inside the `./modules/` folder. This change allows us to validate recipes properly while not causing errors when custom modules are used. + +```yaml ins={4} +modules: + # use the module `./modules/custom-module/` + - type: custom-module + source: local + input: + - value 1 + - value 2 +``` + +### Miscellaneous + +- Minimum supported version of `buildah` is now `1.29`, up from `1.24`. + +## Final words + +Happy holidays everyone! Have fun with the new features, and enjoy your free time whenever you have the chance. +_Stay tuned for the eventual v1!_ diff --git a/src/content/docs/blog/v0_9_0-release.mdx b/src/content/docs/blog/v0_9_0-release.mdx deleted file mode 100644 index 31da02a..0000000 --- a/src/content/docs/blog/v0_9_0-release.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: Release of v0.9.0 -description: Brand new features to make building your images easier! -date: 2024-11-26 -authors: - - name: Gerald (Jerry) Pinder - img: https://avatars.githubusercontent.com/u/4626052 - github: gmpinder ---- -:::tip[TLDR] -The BlueBuild CLI `v0.9.0` update introduces new features and breaking changes. [What do I need to do to migrate?](#breaking_changes) -::: - -# Features - -- Generate ISOs for a fresh install -- New `init` command for creating a new BlueBuild project -- Stages for compiling your favorite programs while keeping dev tools out of your image -- Copy module for copying programs from stages into your final image -- A new `switch` command consolidates `upgrade`/`rebase` commands -- A new `login` command for logging into registries for all tools like `docker`, `skopeo`, `cosign`, etc. -- A new `validate` command and check before building that will tell you where you have errors in your recipes -- A new `prune` command to easily clean build space for the build drivers -- The `sigstore` driver that can handle signing if you don't have `cosign` installed -- The ability to build multiple recipes at the same time - -# Breaking Changes - -- Local modules must now have the `source` property set to `local` - -```yaml -modules: - - type: custom-module - source: local - input: - - value 1 - - value 2 -``` - -- Removal of `yq` and the `get_yaml_array` bash function from the build in favor of `jq` and the new `get_json_array` -- Minimum supported version of `buildah` is now `1.29` up from `1.24` From 345a1384095e7db2d80b63f3ff89ba37a2edd362 Mon Sep 17 00:00:00 2001 From: xyny <60004820+xynydev@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:43:47 +0200 Subject: [PATCH 04/16] docs: change documentation to add generate-iso command (#67) * docs: change documentation to add generate-iso command * feat: add bsky profile * feat: finalize iso generation guide --- src/content/docs/how-to/generate-iso.mdx | 30 ++++++++++++ .../docs/{learn => how-to}/ublue-iso.png | Bin src/content/docs/learn/universal-blue.mdx | 44 +----------------- 3 files changed, 31 insertions(+), 43 deletions(-) create mode 100644 src/content/docs/how-to/generate-iso.mdx rename src/content/docs/{learn => how-to}/ublue-iso.png (100%) diff --git a/src/content/docs/how-to/generate-iso.mdx b/src/content/docs/how-to/generate-iso.mdx new file mode 100644 index 0000000..614e0bd --- /dev/null +++ b/src/content/docs/how-to/generate-iso.mdx @@ -0,0 +1,30 @@ +--- +title: How to build an ISO based on your custom image of Fedora Atomic +description: Using the `bluebuild generate-iso` command +--- + +First you need to choose whether to generate the ISO from remote image or a recipe. + +- Generate from remote image if... + - You're trying to install a custom image made by someone else + - You are actively building and publishing images (this is the default) +- Generate from a recipe if... + - You don't want to rely on a cloud to build your images for you and are willing to manually run builds locally (or set up some system to automate that for you) + +1. Generate the ISO: + + ```bash + # Generate ISO from a built and published remote image + sudo bluebuild generate-iso --iso-name weird-os.iso image ghcr.io/octocat/weird-os + + # Build image and generate ISO from a local recipe + sudo bluebuild generate-iso --iso-name weird-os.iso recipe recipes/recipe.yml + ``` + +2. Flash the ISO onto a USB drive ([Fedora Media Writer](https://www.fedoraproject.org/en/workstation/download) is recommended) and boot it. + + - The ISO file should be inside your working directory (wherever you ran the command). + + - Once booted, you should be presented with a screen similar to this: + + ![](./ublue-iso.png) diff --git a/src/content/docs/learn/ublue-iso.png b/src/content/docs/how-to/ublue-iso.png similarity index 100% rename from src/content/docs/learn/ublue-iso.png rename to src/content/docs/how-to/ublue-iso.png diff --git a/src/content/docs/learn/universal-blue.mdx b/src/content/docs/learn/universal-blue.mdx index 10d1418..67da47e 100644 --- a/src/content/docs/learn/universal-blue.mdx +++ b/src/content/docs/learn/universal-blue.mdx @@ -24,49 +24,7 @@ The examples in this section assume the use of a bash-compatible shell. Temporar ### Fresh install from an ISO -You can use JasonN3's [build-container-installer](https://github.com/JasonN3/build-container-installer) to generate an offline ISO of your image locally. See the project's README for more information it and its configuration. This procedure only requires either `podman` or `docker` be installed. - -1. Generate the ISO: - - - With `podman`: - - ```bash - # iso command: - mkdir ./iso-output - sudo podman run --rm --privileged --volume ./iso-output:/build-container-installer/build --security-opt label=disable --pull=newer \ - ghcr.io/jasonn3/build-container-installer:latest \ - # iso config: - IMAGE_REPO=ghcr.io/octocat \ - IMAGE_NAME=weird-os \ - IMAGE_TAG=latest \ - VARIANT=Silverblue # should match the variant your image is based on - ``` - - - With `docker`: - - ```bash - # iso command: - mkdir ./iso-output - sudo docker run --rm --privileged --volume ./iso-output:/build-container-installer/build --pull=always \ - ghcr.io/jasonn3/build-container-installer:latest \ - # iso config: - IMAGE_REPO=ghcr.io/octocat \ - IMAGE_NAME=weird-os \ - IMAGE_TAG=latest \ - VARIANT=Silverblue # should match the variant your image is based on - ``` - -2. Flash the ISO onto a USB drive ([Fedora Media Writer](https://www.fedoraproject.org/en/workstation/download) is recommended) and boot it, or boot it directly with a virtual machine. - - - The ISO file should be in a directory called `iso-output` inside your working directory and called something like `deploy.iso`. - - - Once booted, you should be presented with a screen similar to this: - - ![](./ublue-iso.png) - -3. Complete the installation by completing all steps and following the installer's instructions. - - - Dual booting is only possible when using separate disks or doing [manual partitioning](https://docs.fedoraproject.org/en-US/fedora-silverblue/installation/#manual-partition) (unsupported). +Follow the [how to -guide](/how-to/generate-iso/). ### By rebasing from an existing installation of Fedora atomic (or a derivative) From d1dd004e7b1e10040b04a7d75b1bd2efb5199d31 Mon Sep 17 00:00:00 2001 From: fiftydinar <65243233+fiftydinar@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:44:16 +0100 Subject: [PATCH 05/16] docs(module): Document `get_json_array` instead of now depreciated `get_yaml_array` (#70) * docs(module): Document `get_json_array` instead of now depreciated `get_yaml_array` * fix: remove tool name from array key --------- Co-authored-by: xyny <60004820+xynydev@users.noreply.github.com> --- src/content/docs/reference/module.mdx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/content/docs/reference/module.mdx b/src/content/docs/reference/module.mdx index 72982f8..fc45a68 100644 --- a/src/content/docs/reference/module.mdx +++ b/src/content/docs/reference/module.mdx @@ -74,12 +74,18 @@ Environment variable containing the URL of the OCI image used as the base. Environment variable containing the major version of running operating system. The value is gathered from the `VERSION_ID` in `/etc/os-release`. -### `get_yaml_array` +### `get_json_array` Bash function that helps with reading arrays from the module's configuration. ```bash frame="none" -get_yaml_array OUTPUT_VAR_NAME '.yq.key.to.array[]' "$1" +get_json_array OUTPUT_VAR_NAME '.key.to.array[]' "${1}" +``` + +or less readable, but more safe command for extracting array values: + +```bash frame="none" +get_json_array OUTPUT_VAR_NAME '.["key"].["to"].["array"][]' "${1}" ``` ## `module.yml` From c8567c39345c1161ffd7295eaad811d2efba1a68 Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 18:56:14 +0200 Subject: [PATCH 06/16] fix: remove last remaining outdated mentions of `yq` --- src/content/docs/blog/caching-update.mdx | 136 +++++++++--------- .../docs/blog/v090-features-changes.mdx | 2 + src/content/docs/how-to/making-modules.mdx | 8 +- src/content/docs/how-to/minimal-setup.mdx | 14 +- src/content/docs/reference/module.mdx | 2 +- 5 files changed, 86 insertions(+), 76 deletions(-) diff --git a/src/content/docs/blog/caching-update.mdx b/src/content/docs/blog/caching-update.mdx index aeab79c..4818b49 100644 --- a/src/content/docs/blog/caching-update.mdx +++ b/src/content/docs/blog/caching-update.mdx @@ -7,13 +7,14 @@ authors: img: https://avatars.githubusercontent.com/u/4626052 github: gmpinder --- + :::tip[TLDR] A recent BlueBuild CLI update makes builds and updates much faster. [What do I need to do to take advantage?](#migration) ::: Hello! I'm Jerry and I'm the creator and maintainer of the Rust-based `bluebuild` CLI tool. I started creating this tool as a way to extend the work that [XYNY](https://github.com/xynydev) did with the recipe standard, but make it so that I didn't have to manage the `Containerfile` directly. The tool is an integral part of the project that handles Containerfile generation from the recipe, the building of container images, and pushing them to the registry. -For the past month or so, we've been working on trying to make the building experience better for our users. One of the biggest concerns brought up was the size of updates when using `rpm-ostree upgrade` to pull your new changes. The size of the updates would end up being bigger than the original single `RUN build.sh` instruction that was used. While this was really great for the time, more advanced uses of the legacy `startingpoint` repo required users to know how to manage a `Containerfile`. This can be really intimidating to less-technical users. One of the `bluebuild` CLI's goals is to perform most of the optimizations for the user so they don't have to worry about setting that up. +For the past month or so, we've been working on trying to make the building experience better for our users. One of the biggest concerns brought up was the size of updates when using `rpm-ostree upgrade` to pull your new changes. The size of the updates would end up being bigger than the original single `RUN build.sh` instruction that was used. While this was really great for the time, more advanced uses of the legacy `startingpoint` repo required users to know how to manage a `Containerfile`. This can be really intimidating to less-technical users. One of the `bluebuild` CLI's goals is to perform most of the optimizations for the user so they don't have to worry about setting that up. ## Migration @@ -23,11 +24,24 @@ I'm happy to announce that we have now released `v0.8.4` of `bluebuild` CLI (and - This does not include all the other files/directories in your `./config/` like `./config/scripts/` or `./config/files/` - Any `.yml`/`.yaml` file that contains information for the modules to build your image are your recipe files. - Be sure to update any use of `from-file:` to account for any changes in your directory structure - - For example if the recipes were in `./config/recipes/` and extended recipe files in `./config/recipes/image_configs/`. - - One of the recipes calls `from-file: recipes/image_configs/common.yml`. - ``` - config - └─recipes + - For example if the recipes were in `./config/recipes/` and extended recipe files in `./config/recipes/image_configs/`. + - One of the recipes calls `from-file: recipes/image_configs/common.yml`. + ``` + config + └─recipes + ├── image_configs + │ ├── common.yml + │ ├── gnome.yml + │ └── kde.yml + ├── recipe-gnome-nvidia.yml + ├── recipe-gnome.yml + ├── recipe-kde-nvidia.yml + └── recipe-kde.yml + ``` + - You could move `recipes` up a level to be: + ``` + config + recipes ├── image_configs │ ├── common.yml │ ├── gnome.yml @@ -36,24 +50,11 @@ I'm happy to announce that we have now released `v0.8.4` of `bluebuild` CLI (and ├── recipe-gnome.yml ├── recipe-kde-nvidia.yml └── recipe-kde.yml - ``` - - You could move `recipes` up a level to be: - ``` - config - recipes - ├── image_configs - │ ├── common.yml - │ ├── gnome.yml - │ └── kde.yml - ├── recipe-gnome-nvidia.yml - ├── recipe-gnome.yml - ├── recipe-kde-nvidia.yml - └── recipe-kde.yml - ``` - - Then `from-file:` can have the path set to `image_configs/common.yml` + ``` + - Then `from-file:` can have the path set to `image_configs/common.yml` - Be sure to update your workflow file too - - If your `recipe.yml` was located in `./config/` and you moved it to `./recipes/`, the GHA will already take that into account - - The thing to look out for is the recipe's relative location to the "root" of recipe locations + - If your `recipe.yml` was located in `./config/` and you moved it to `./recipes/`, the GHA will already take that into account + - The thing to look out for is the recipe's relative location to the "root" of recipe locations 2. It's also suggested to move the `./config/containerfiles/` directory into the root of your repo too. - You can see the docs for the `containerfile` module [here](https://blue-build.org/reference/modules/containerfile/). 3. Update your GHA to be at least `v1.4` @@ -82,29 +83,29 @@ Here's a snippet of my recipe before the change. name: jp-laptop description: The image of Wunker OS for JP's Laptop. base_image: ghcr.io/ublue-os/bazzite -image_version: '39' +image_version: "39" modules: -# ... -- type: script - scripts: - - setup-selinux-dockersock.sh -- type: script - scripts: - - setup-kubectl.sh -- type: rpm-ostree - repos: - - https://pkg.earthly.dev/earthly.repo - - https://cli.github.com/packages/rpm/gh-cli.repo - install: - - earthly - - neovim - - helix - - alacritty - - gh -- type: script - scripts: - - install-mkcert.sh - - install-codelldb.sh + # ... + - type: script + scripts: + - setup-selinux-dockersock.sh + - type: script + scripts: + - setup-kubectl.sh + - type: rpm-ostree + repos: + - https://pkg.earthly.dev/earthly.repo + - https://cli.github.com/packages/rpm/gh-cli.repo + install: + - earthly + - neovim + - helix + - alacritty + - gh + - type: script + scripts: + - install-mkcert.sh + - install-codelldb.sh ``` And here's the change. I'm removing `neovim` cause I'm a filthy `helix` user. @@ -113,28 +114,28 @@ And here's the change. I'm removing `neovim` cause I'm a filthy `helix` user. name: jp-laptop description: The image of Wunker OS for JP's Laptop. base_image: ghcr.io/ublue-os/bazzite -image_version: '39' +image_version: "39" modules: -# ... -- type: script - scripts: - - setup-selinux-dockersock.sh -- type: script - scripts: - - setup-kubectl.sh -- type: rpm-ostree - repos: - - https://pkg.earthly.dev/earthly.repo - - https://cli.github.com/packages/rpm/gh-cli.repo - install: - - earthly - - helix - - alacritty - - gh -- type: script - scripts: - - install-mkcert.sh - - install-codelldb.sh + # ... + - type: script + scripts: + - setup-selinux-dockersock.sh + - type: script + scripts: + - setup-kubectl.sh + - type: rpm-ostree + repos: + - https://pkg.earthly.dev/earthly.repo + - https://cli.github.com/packages/rpm/gh-cli.repo + install: + - earthly + - helix + - alacritty + - gh + - type: script + scripts: + - install-mkcert.sh + - install-codelldb.sh ``` So we re-run the build. @@ -146,7 +147,6 @@ So we re-run the build. => CACHED [stage-keys 1/1] COPY cosign.pub /keys/jp-desktop-gaming.pub 0.0s => CACHED [stage-4 2/16] RUN --mount=type=bind,from=stage-keys,src=/keys,dst=/tmp/keys mkdir -p /usr/etc/pki/containers/ && cp /tmp/keys/* /usr/et 0.0s => CACHED [stage-bins 1/3] COPY --from=gcr.io/projectsigstore/cosign /ko-app/cosign /bins/cosign 0.0s - => CACHED [stage-bins 2/3] COPY --from=docker.io/mikefarah/yq /usr/bin/yq /bins/yq 0.0s => CACHED [stage-bins 3/3] COPY --from=ghcr.io/blue-build/cli:main-installer /out/bluebuild /bins/bluebuild 0.0s => CACHED [stage-4 3/16] RUN --mount=type=bind,from=stage-bins,src=/bins,dst=/tmp/bins mkdir -p /usr/bin/ && cp /tmp/bins/* /usr/bin/ && ostree 0.0s => CACHED [stage-4 4/16] RUN --mount=type=tmpfs,target=/var --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw --mount=type=bind 0.0s @@ -185,6 +185,6 @@ No you don't. We will continue to support the legacy method for the time being. ## Final words -Hopefully I was able to explain how these changes will help you in your building ventures. We'll be working more on creating useful features as well as optimizing your building experience. +Hopefully I was able to explain how these changes will help you in your building ventures. We'll be working more on creating useful features as well as optimizing your building experience. Happy building! diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 6b89076..bb50277 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -101,6 +101,8 @@ echo "$VAR" + get_json_array ARRAY '.["array"][]' "$1" ``` +Read more on the [updated custom module how to -guide](/how-to/making-modules/). + #### New way to use a local modules Local modules must now have the `source` property set to `local`. Local modules are those that live inside the same repository as your custom image, inside the `./modules/` folder. This change allows us to validate recipes properly while not causing errors when custom modules are used. diff --git a/src/content/docs/how-to/making-modules.mdx b/src/content/docs/how-to/making-modules.mdx index 83bc12f..1080d49 100644 --- a/src/content/docs/how-to/making-modules.mdx +++ b/src/content/docs/how-to/making-modules.mdx @@ -23,18 +23,20 @@ If you want to extend your image with custom functionality that requires configu This guide only includes the bare minimum information to get you started on your coding adventure. Check out the [module reference](/reference/module/) for more technical information about modules. -When being launched, your module receives its configuration as a JSON string as the first argument. It can be read from in bash using `jq` or `yq` like this: +When being launched, your module receives its configuration as a JSON string as the first argument. It can be read from in bash using `jq` like this: ```bash title="modules//.sh" #!/usr/bin/env bash set -euo pipefail # read a single variable from the configuration -VAR=$(echo "$1" | yq -I=0 ".var") # `-I=0` makes sure the output isn't indented +# `try` makes the command output 'null' if the key is not found, otherwise it will error out and the build will fail +# the `.["var"]` syntax is optional and could be replaced with the less safe and more error-prone `.var` syntax +VAR=$(echo "$1" | jq -r 'try .["var"]') echo "$VAR" # read an array from the configuration -get_yaml_array ARRAY '.array[]' "$1" +get_json_array ARRAY '.["array"][]' "$1" # loop over the array for THING in "${ARRAY[@]}"; do echo "$THING" diff --git a/src/content/docs/how-to/minimal-setup.mdx b/src/content/docs/how-to/minimal-setup.mdx index f050f8a..3d0a3e7 100644 --- a/src/content/docs/how-to/minimal-setup.mdx +++ b/src/content/docs/how-to/minimal-setup.mdx @@ -8,13 +8,16 @@ The [BlueBuild CLI](https://github.com/blue-build/cli) is used to build a [recip 0. To follow this tutorial, you need to have a setup with a Containerfile that is used to build a custom image of atomic Fedora. - If you don't already have such as setup and don't know where to get started the [`ublue-os/image-template`](https://github.com/ublue-os/image-template/) is a good minimal place to start. 1. Make the following changes to your Containerfile - - Add this below each of the `FROM` lines that define images you wish to use BlueBuild modules in + + - (optional) Add this below each of the `FROM` lines that define images you wish to use BlueBuild modules with YAML configuration in + ```bash frame="none" - # Many BlueBuild modules use yq to parse yaml - # and it can also be used to pass modules configuration written in yaml + # `yq` be used to pass BlueBuild modules configuration written in yaml COPY --from=docker.io/mikefarah/yq /usr/bin/yq /usr/bin/yq ``` + 2. Add a `RUN` statement for the module you wish to use + ```bash frame="none" # Run BlueBuild's gnome-extensions module RUN \ @@ -26,8 +29,10 @@ The [BlueBuild CLI](https://github.com/blue-build/cli) is used to build a [recip /tmp/scripts/run_module.sh 'gnome-extensions' \ '{"type":"gnome-extensions","install":["Vitals","GSConnect","Burn My Windows","PaperWM","Gnome 4x UI Improvements"]}' ``` + - The `run_module.sh` script takes in two arguments; the module's name and it's configuration as a JSON string. - - If you wish to provide the module configuration as YAML instead of JSON, you can use the following code snippet at the bottom of the `RUN` statement shown above instead. (make sure to add `\n\` to the end of each line) + - If you wish to provide the module configuration as YAML instead of JSON, you can use the following code snippet at the bottom of the `RUN` statement shown above instead. (make sure to add `\n\` to the end of each line, and that you have `yq` installed) + ```bash frame="none" # run the module config=$'\ @@ -41,4 +46,5 @@ The [BlueBuild CLI](https://github.com/blue-build/cli) is used to build a [recip ' && \ /tmp/scripts/run_module.sh "$(echo "$config" | yq eval '.type')" "$(echo "$config" | yq eval -o=j -I=0)" ``` + - If you wish to use a module that expects you to include some files, you can copy those to `/tmp/files/` as that is to the directory where the `./files/` directory is accessible in a standard BlueBuild build. diff --git a/src/content/docs/reference/module.mdx b/src/content/docs/reference/module.mdx index fc45a68..f50cf0f 100644 --- a/src/content/docs/reference/module.mdx +++ b/src/content/docs/reference/module.mdx @@ -82,7 +82,7 @@ Bash function that helps with reading arrays from the module's configuration. get_json_array OUTPUT_VAR_NAME '.key.to.array[]' "${1}" ``` -or less readable, but more safe command for extracting array values: +or less readable, but safer command for extracting array values: ```bash frame="none" get_json_array OUTPUT_VAR_NAME '.["key"].["to"].["array"][]' "${1}" From fa5e3cbd79cb8513cdd58635d7466e051a4d9aee Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 19:38:32 +0200 Subject: [PATCH 07/16] chore: add `try` to `get_json_array` calls --- src/content/docs/blog/v090-features-changes.mdx | 4 ++-- src/content/docs/how-to/making-modules.mdx | 2 +- src/content/docs/reference/module.mdx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index bb50277..68c9908 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -79,7 +79,7 @@ Internal changes and refactors always might affect your custom modules, but we t #### Removal of [`yq`](https://github.com/mikefarah/yq) -We no longer include `yq` by default in images built with BlueBuild, and have refactored all modules to use `jq` instead. This comes in tandem with our experimentation with using Nushell to build some new modules, and a concern of `yq` being included unconditionally regardless of it is actually needed in an image, increasing attack surface. Read more about this from the [related GitHub issue](https://github.com/blue-build/cli/issues/261). +We no longer include `yq` by default in images built with BlueBuild, and have refactored all modules to use `jq` instead. This comes in tandem with our experimentation [with using Nushell](https://github.com/blue-build/modules/issues/212) to build some new modules, and a concern of `yq` being included unconditionally regardless of it is actually needed in an image, increasing attack surface. Read more about this from the [related GitHub issue](https://github.com/blue-build/cli/issues/261). What this means for you: @@ -98,7 +98,7 @@ echo "$VAR" # read an array from the configuration - get_yaml_array ARRAY '.array[]' "$1" -+ get_json_array ARRAY '.["array"][]' "$1" ++ get_json_array ARRAY 'try .["array"][]' "$1" ``` Read more on the [updated custom module how to -guide](/how-to/making-modules/). diff --git a/src/content/docs/how-to/making-modules.mdx b/src/content/docs/how-to/making-modules.mdx index 1080d49..6d2a6bf 100644 --- a/src/content/docs/how-to/making-modules.mdx +++ b/src/content/docs/how-to/making-modules.mdx @@ -36,7 +36,7 @@ VAR=$(echo "$1" | jq -r 'try .["var"]') echo "$VAR" # read an array from the configuration -get_json_array ARRAY '.["array"][]' "$1" +get_json_array ARRAY 'try .["array"][]' "$1" # loop over the array for THING in "${ARRAY[@]}"; do echo "$THING" diff --git a/src/content/docs/reference/module.mdx b/src/content/docs/reference/module.mdx index f50cf0f..c922e39 100644 --- a/src/content/docs/reference/module.mdx +++ b/src/content/docs/reference/module.mdx @@ -79,13 +79,13 @@ Environment variable containing the major version of running operating system. T Bash function that helps with reading arrays from the module's configuration. ```bash frame="none" -get_json_array OUTPUT_VAR_NAME '.key.to.array[]' "${1}" +get_json_array OUTPUT_VAR_NAME 'try .key.to.array[]' "${1}" ``` or less readable, but safer command for extracting array values: ```bash frame="none" -get_json_array OUTPUT_VAR_NAME '.["key"].["to"].["array"][]' "${1}" +get_json_array OUTPUT_VAR_NAME 'try .["key"].["to"].["array"][]' "${1}" ``` ## `module.yml` From bd38f42c328d9b8826804bd5149b65310f2bfcf0 Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 20:01:19 +0200 Subject: [PATCH 08/16] feat: archive legacy template --- src/content/docs/blog/v090-features-changes.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 68c9908..4bb2ddc 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -117,6 +117,14 @@ modules: - value 2 ``` +### Phasing out official support for [blue-build/legacy-template](blue-build/legacy-template) + +With the switch to `jq` and `get_json_array` as talked about above, the 'legacy template', aka the old 'startingpoint', is starting to become ever more broken. As such we will no longer be updating the template to accomodate for new changes. The repository is now archived, and a message is left in the README. + +If you're _one of the few people who still_ run their image builds from a repository based on it, and you are still not considering [migration to the new system](/blog/introducing-bluebuild/#how-to-migrate), _you shall be crowned the new absolute ruler of your repository, in charge of keeping the builds running without someone telling you what to do._ + +Some things that might help you on your quest are [our guide to running BlueBuild modules from a Containerfile directly](/how-to/minimal-setup/), and plain-old reading the source code of [BlueBuild's CLI](https://github.com/blue-build/cli), especially the file containing the [bash exports for modules](https://github.com/blue-build/cli/blob/main/scripts/exports.sh) and the [Containerfile template used by BlueBuild images](https://github.com/blue-build/cli/blob/main/template/templates/Containerfile.j2). + ### Miscellaneous - Minimum supported version of `buildah` is now `1.29`, up from `1.24`. From 395782ab29dee56c84c8ceab0c32c42854c2e2fa Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 20:04:28 +0200 Subject: [PATCH 09/16] fix: add proper description --- src/content/docs/blog/v090-features-changes.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 4bb2ddc..7b84e68 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -1,6 +1,6 @@ --- title: New CLI Features & Breaking Changes — v0.9.0 -description: Brand new features to make building your images easier! +description: Stay up-to-date on new CLI features and breaking changes related to custom modules. date: 2024-12-02 authors: - name: Gerald (Jerry) Pinder From 96ca4d16c0b310bdf58f843f04a24168fbac0554 Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 20:06:53 +0200 Subject: [PATCH 10/16] fix: typo --- src/content/docs/blog/v090-features-changes.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 7b84e68..7dc43cd 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -15,7 +15,7 @@ authors: The BlueBuild CLI `v0.9.0` update introduces **breaking changes**. [Show me what you broke!](#breaking-changes) ::: -The BlueBuild CLI is the tool that builds all BlueBuild custom images. It is also installed on every image built with BlueBuild and can be used to build and tinker with images locally. Lately we _(gmpinder)_ been hard at work on a new CLI version to automate many administrative tasks you have to do as a custom image creator. But enough of the fluff, let's get right to it! +The BlueBuild CLI is the tool that builds all BlueBuild custom images. It is also installed on every image built with BlueBuild and can be used to build and tinker with images locally. Lately we _(gmpinder)_ have been hard at work on a new CLI version to automate many administrative tasks you have to do as a custom image creator. But enough of the fluff, let's get right to it! ## New Features From ea7a5b2e517dc82955f697ccae3322b623ddabe9 Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 20:10:47 +0200 Subject: [PATCH 11/16] fix: typo --- src/content/docs/blog/v090-features-changes.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 7dc43cd..6a79ae8 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -79,7 +79,7 @@ Internal changes and refactors always might affect your custom modules, but we t #### Removal of [`yq`](https://github.com/mikefarah/yq) -We no longer include `yq` by default in images built with BlueBuild, and have refactored all modules to use `jq` instead. This comes in tandem with our experimentation [with using Nushell](https://github.com/blue-build/modules/issues/212) to build some new modules, and a concern of `yq` being included unconditionally regardless of it is actually needed in an image, increasing attack surface. Read more about this from the [related GitHub issue](https://github.com/blue-build/cli/issues/261). +We no longer include `yq` by default in images built with BlueBuild, and have refactored all modules to use `jq` instead. This comes in tandem with our experimentation [with using Nushell](https://github.com/blue-build/modules/issues/212) to build some new modules, and a concern of `yq` being included unconditionally regardless of if it's actually needed in an image, increasing attack surface. Read more about this from the [related GitHub issue](https://github.com/blue-build/cli/issues/261). What this means for you: From 2af3bbfa98cb67e05b86520cb5841a3b1e627440 Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 20:11:46 +0200 Subject: [PATCH 12/16] fix: change to languagetool approved hyphenation of how-to guide --- src/content/docs/blog/v090-features-changes.mdx | 4 ++-- src/content/docs/learn/universal-blue.mdx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 6a79ae8..823b1d6 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -21,7 +21,7 @@ The BlueBuild CLI is the tool that builds all BlueBuild custom images. It is als ### Generate ISOs for a fresh install -You can now generate offline ISO installation images as shown in the [how to -guide](/how-to/generate-iso/). Under the hood this is a wrapper of [JasonN3's build-container-installer](https://github.com/JasonN3/build-container-installer). Feel free to report issues to the CLI repository first, and to the upstream project only if the issue is deemed to be caused by them. +You can now generate offline ISO installation images as shown in the [how-to guide](/how-to/generate-iso/). Under the hood this is a wrapper of [JasonN3's build-container-installer](https://github.com/JasonN3/build-container-installer). Feel free to report issues to the CLI repository first, and to the upstream project only if the issue is deemed to be caused by them. ### Quickly start a new BlueBuild project from the command line @@ -101,7 +101,7 @@ echo "$VAR" + get_json_array ARRAY 'try .["array"][]' "$1" ``` -Read more on the [updated custom module how to -guide](/how-to/making-modules/). +Read more on the [updated custom module how-to guide](/how-to/making-modules/). #### New way to use a local modules diff --git a/src/content/docs/learn/universal-blue.mdx b/src/content/docs/learn/universal-blue.mdx index 67da47e..1fe7328 100644 --- a/src/content/docs/learn/universal-blue.mdx +++ b/src/content/docs/learn/universal-blue.mdx @@ -24,7 +24,7 @@ The examples in this section assume the use of a bash-compatible shell. Temporar ### Fresh install from an ISO -Follow the [how to -guide](/how-to/generate-iso/). +Follow the [how-to guide](/how-to/generate-iso/). ### By rebasing from an existing installation of Fedora atomic (or a derivative) From 25f6ebed24d8a6e4c2c90e28d892da98eee7311e Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 2 Dec 2024 20:16:01 +0200 Subject: [PATCH 13/16] style: make all languagetool recommended grammar changes and some other formatting --- src/content/docs/blog/v090-features-changes.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 823b1d6..5df2e0b 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -56,7 +56,7 @@ INFO => Created new BlueBuild project in ./weird-os ### Build stages for compiling programs from source while keeping your image clean -You can define stages with a new top-level `stages:` key in the recipe before the `modules:`. Stages use the same module ssystem as the rest of the build, but you'll probably find the [`script`](/reference/modules/script/) module most useful. +You can define stages with a new top-level `stages:` key in the recipe before the `modules:`. Stages use the same module system as the rest of the build, but you'll probably find the [`script`](/reference/modules/script/) module most useful. After building something in a stage, you can use the newly stable [`copy`](/reference/modules/copy/) module to copy files from the stage. This maps directly to a `COPY` statement in the `Containerfile`. @@ -119,11 +119,11 @@ modules: ### Phasing out official support for [blue-build/legacy-template](blue-build/legacy-template) -With the switch to `jq` and `get_json_array` as talked about above, the 'legacy template', aka the old 'startingpoint', is starting to become ever more broken. As such we will no longer be updating the template to accomodate for new changes. The repository is now archived, and a message is left in the README. +With the switch to `jq` and `get_json_array` as talked about above, the 'legacy template', aka the old 'startingpoint', is starting to become ever more broken. As such, we will no longer be updating the template to accommodate for new changes. The repository is now archived, and a message is left in the README. If you're _one of the few people who still_ run their image builds from a repository based on it, and you are still not considering [migration to the new system](/blog/introducing-bluebuild/#how-to-migrate), _you shall be crowned the new absolute ruler of your repository, in charge of keeping the builds running without someone telling you what to do._ -Some things that might help you on your quest are [our guide to running BlueBuild modules from a Containerfile directly](/how-to/minimal-setup/), and plain-old reading the source code of [BlueBuild's CLI](https://github.com/blue-build/cli), especially the file containing the [bash exports for modules](https://github.com/blue-build/cli/blob/main/scripts/exports.sh) and the [Containerfile template used by BlueBuild images](https://github.com/blue-build/cli/blob/main/template/templates/Containerfile.j2). +Some things that might help you on your quest are [our guide to running BlueBuild modules from a Containerfile directly](/how-to/minimal-setup/) and plain-old reading the source code of [BlueBuild's CLI](https://github.com/blue-build/cli), especially the file containing the [bash exports for modules](https://github.com/blue-build/cli/blob/main/scripts/exports.sh) and the [Containerfile template used by BlueBuild images](https://github.com/blue-build/cli/blob/main/template/templates/Containerfile.j2). ### Miscellaneous @@ -131,5 +131,5 @@ Some things that might help you on your quest are [our guide to running BlueBuil ## Final words -Happy holidays everyone! Have fun with the new features, and enjoy your free time whenever you have the chance. -_Stay tuned for the eventual v1!_ +Happy holidays, everyone! Have fun with the new features, and enjoy your free time whenever you have the chance. +_Stay tuned for the eventual `v1.0.0`!_ From ba0fd71df7528c30e8b6e30317bd15b2a572d794 Mon Sep 17 00:00:00 2001 From: xyny Date: Fri, 6 Dec 2024 13:19:37 +0200 Subject: [PATCH 14/16] fix: finish up --- .../docs/blog/v090-features-changes.mdx | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 5df2e0b..6c02ae1 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -1,7 +1,7 @@ --- title: New CLI Features & Breaking Changes — v0.9.0 description: Stay up-to-date on new CLI features and breaking changes related to custom modules. -date: 2024-12-02 +date: 2024-12-06 authors: - name: Gerald (Jerry) Pinder img: https://avatars.githubusercontent.com/u/4626052 @@ -17,13 +17,34 @@ The BlueBuild CLI `v0.9.0` update introduces **breaking changes**. [Show me what The BlueBuild CLI is the tool that builds all BlueBuild custom images. It is also installed on every image built with BlueBuild and can be used to build and tinker with images locally. Lately we _(gmpinder)_ have been hard at work on a new CLI version to automate many administrative tasks you have to do as a custom image creator. But enough of the fluff, let's get right to it! +## How do I update? + +:::tip[Wait a moment...] +It's recommended that you read the rest of the article before updating, but if you're busy, here's the instructions. +::: + +Updates to the BlueBuild GitHub Action automatically update the CLI version as well. Your repository should also get an update PR for the new Action version thanks to Dependabot. If the Dependabot PR hasn't landed yet, though, you can manually delve into `build.yml` and make the following update. + +```diff lang="yaml" +jobs: + bluebuild: + steps: + - name: Build Custom Image +- uses: blue-build/github-action@v1.7 ++ uses: blue-build/github-action@v1.8 +``` + +Voilà! That was easy. + +And if you're not using GitHub, just update wherever you might be specifying the CLI version to the latest one. With local builds, a simple rebuild should be enough to get the latest CLI version baked into your image at `/usr/bin/bluebuild`. + ## New Features ### Generate ISOs for a fresh install You can now generate offline ISO installation images as shown in the [how-to guide](/how-to/generate-iso/). Under the hood this is a wrapper of [JasonN3's build-container-installer](https://github.com/JasonN3/build-container-installer). Feel free to report issues to the CLI repository first, and to the upstream project only if the issue is deemed to be caused by them. -### Quickly start a new BlueBuild project from the command line +### Quickstart a new BlueBuild project from the command line You can now use the `bluebuild new` and `bluebuild init` commands to start a new BlueBuild project from the command line. This will set up a new local git repository for you based on the [template](https://github.com/blue-build/template/) and some short configuration questions. (`new` creates a project in a new directory, `init` in the current empty one) @@ -54,6 +75,14 @@ Public key written to cosign.pub INFO => Created new BlueBuild project in ./weird-os ``` +### Image rechunking for more efficient diffs and updates + +You can now enable rechunking for all your ostree-based custom images to make your resulting images more efficient at the cost of some build time. Rechunking is done using [github.com/hhd-dev/rechunk](https://github.com/hhd-dev/rechunk), thanks to all the contributors for this enhancement! + +To enable rechunk on GitHub, add `rechunk: true` to the parameters given to the BlueBuild GitHub Action. Locally and elsewhere, it's just a `--rechunk` flag for the `bluebuild build` command. Read more on the [reference page](/reference/github-action/#rechunk-optional). + +If you're regularly making changes to your image and waiting to see if the build is successful, enabling rechunking will make the wait time slower. Feel free to not enable rechunk if you'd rather optimize build time than user bandwidth. + ### Build stages for compiling programs from source while keeping your image clean You can define stages with a new top-level `stages:` key in the recipe before the `modules:`. Stages use the same module system as the rest of the build, but you'll probably find the [`script`](/reference/modules/script/) module most useful. @@ -79,7 +108,7 @@ Internal changes and refactors always might affect your custom modules, but we t #### Removal of [`yq`](https://github.com/mikefarah/yq) -We no longer include `yq` by default in images built with BlueBuild, and have refactored all modules to use `jq` instead. This comes in tandem with our experimentation [with using Nushell](https://github.com/blue-build/modules/issues/212) to build some new modules, and a concern of `yq` being included unconditionally regardless of if it's actually needed in an image, increasing attack surface. Read more about this from the [related GitHub issue](https://github.com/blue-build/cli/issues/261). +We no longer include `yq` by default in images built with BlueBuild, and have refactored all modules to use `jq` instead (as such, modules using `get_json_array` are now also broken on older CLI versions). This comes in tandem with our experimentation [with using Nushell](https://github.com/blue-build/modules/issues/212) to build some new modules, and a concern of `yq` being included unconditionally regardless of if it's actually needed in an image, increasing attack surface. Read more about this from the [related GitHub issue](https://github.com/blue-build/cli/issues/261). What this means for you: From ea1731e07371e8dd70273560336c0278d2d6a49d Mon Sep 17 00:00:00 2001 From: xyny Date: Fri, 6 Dec 2024 13:51:33 +0200 Subject: [PATCH 15/16] feat: add breaking change about recipe validation --- .../docs/blog/v090-features-changes.mdx | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 6c02ae1..06d7943 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -154,6 +154,41 @@ If you're _one of the few people who still_ run their image builds from a reposi Some things that might help you on your quest are [our guide to running BlueBuild modules from a Containerfile directly](/how-to/minimal-setup/) and plain-old reading the source code of [BlueBuild's CLI](https://github.com/blue-build/cli), especially the file containing the [bash exports for modules](https://github.com/blue-build/cli/blob/main/scripts/exports.sh) and the [Containerfile template used by BlueBuild images](https://github.com/blue-build/cli/blob/main/template/templates/Containerfile.j2). +### Recipe validation strictness + +Recipe validation, which runs by default on every build, might break your build if you you include in your recipe the key of an object or array, but do not populate the it with anything. This is because the parser fails to see the type of the parameter as an object or an array, and fails with an `incorrect type` error. In this case, you either need to delete the whole configuration key, or alternatively declare the value to either be `{}` (an empty object) or `[]` (an empty array). + +For example: + +```yaml ins="{}" ins="[]" del={24} +modules: + # This will fail validation + - type: default-flatpaks + user: + install: + - org.mozilla.firefox + remove: + system: + + # This will validate + # (no Flatpaks will be removed, but the system Flathub repo will be set up) + - type: default-flatpaks + user: + install: + - org.mozilla.firefox + remove: [] + system: {} + + # But you can also just leave out the `remove:` intirely + # without changing what the module does + - type: default-flatpaks + user: + install: + - org.mozilla.firefox + remove: + system: {} +``` + ### Miscellaneous - Minimum supported version of `buildah` is now `1.29`, up from `1.24`. @@ -162,3 +197,7 @@ Some things that might help you on your quest are [our guide to running BlueBuil Happy holidays, everyone! Have fun with the new features, and enjoy your free time whenever you have the chance. _Stay tuned for the eventual `v1.0.0`!_ + +``` + +``` From 6a9b2a78e21548fd912ec5bd2e2f56f872ebbac3 Mon Sep 17 00:00:00 2001 From: xyny Date: Fri, 6 Dec 2024 13:52:56 +0200 Subject: [PATCH 16/16] fix: when did i add an empty code block there? --- src/content/docs/blog/v090-features-changes.mdx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/content/docs/blog/v090-features-changes.mdx b/src/content/docs/blog/v090-features-changes.mdx index 06d7943..54287c9 100644 --- a/src/content/docs/blog/v090-features-changes.mdx +++ b/src/content/docs/blog/v090-features-changes.mdx @@ -197,7 +197,3 @@ modules: Happy holidays, everyone! Have fun with the new features, and enjoy your free time whenever you have the chance. _Stay tuned for the eventual `v1.0.0`!_ - -``` - -```