No description
Find a file
Hikari e069346e15
feat: Bugreport command (#28)
Add a bug report + completions command(not complete yet) so that new
users can easily submit bugs to us, and I wanted completions for bb
(super easy with clap)

---------

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
2024-01-31 09:51:13 -05:00
.cargo feat: upgrades (#26) 2024-01-27 19:07:03 -05:00
.github chore: Setup earthly satellite building (#29) 2024-01-28 13:20:13 -06:00
.helix feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
src feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
templates feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
.earthlyignore Add ability to use incremental caching for rust builds in Earthfile 2023-12-27 16:36:16 -05:00
.gitignore feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
.rusty-hook.toml feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
build.rs feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
Cargo.lock feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
Cargo.toml feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
CHANGELOG.md Release blue-build v0.5.5 2024-01-26 16:16:26 -05:00
Earthfile feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
install.sh fix: Install script not working as intended (#15) 2024-01-26 16:12:45 -05:00
justfile feat: upgrades (#26) 2024-01-27 19:07:03 -05:00
LICENSE Add LICENSE 2023-10-01 20:57:24 +00:00
README.md chore: Update/Remove logos in this repo (#23) (#30) 2024-01-28 14:15:33 -05:00
rust-toolchain.toml feat: Bugreport command (#28) 2024-01-31 09:51:13 -05:00
rustfmt.toml feat: upgrades (#26) 2024-01-27 19:07:03 -05:00

BlueBuild. A minimal logo with a blue-billed duck holding a golden wrench in its beak.

BlueBuild

BlueBuild's command line program that builds Containerfiles and custom images based on your recipe.yml.

Installation

Distrobox

We package a fedora-toolbox and alpine image with all the tools needed to run bb. You can use distrobox to run the application without needing to install it on your machine.

distrobox create blue-build --image ghcr.io/blue-build/cli
distrobox enter blue-build

Cargo

This is the best way to install as it gives you the opportunity to bulid for your specific environment.

cargo install --locked blue-build

Podman/Docker

This will install the binary on your system in /usr/local/bin. This is only a linux-gnu version.

podman run --rm ghcr.io/blue-build/cli:latest-installer | bash

How to use

Templating

Once you have the CLI tool installed, you can run the following to pull in your recipe file to generate a Containerfile.

bb template -o <CONTAINERFILE> <RECIPE_FILE>

You can then use this with podman or buildah to build and publish your image. Further options can be viewed by running bb template --help

Building

If you don't care about the details of the template, you can run the build command.

bb build ./config/recipe.yaml

This will template out the file and build with buildah or podman.

Local Builds

Rebase

If you want to test your changes, you can do so by using the rebase command. This will create an image as a .tar.gz file, store it in /etc/blue-build, an run rpm-ostree rebase on that newly built file.

sudo bb rebase config/recipe.yml

You can initiate an immediate restart by adding the --reboot/-r option.

Upgrade

When you've rebased onto a local image archive, you can update your image for your recipe by running:

sudo bb upgrade config/recipe.yml

The --reboot argument can be used with this command as well.

CI Builds

If you're running in Gitlab CI, it will automatically sign your image using Gitlab's own OIDC service. Here's an example of a .gitlab-ci.yaml:

workflow:
  rules:
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
      when: never
    - if: "$CI_COMMIT_TAG"
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
      when: never
    - if: "$CI_COMMIT_BRANCH"
stages:
  - build
variables:
  ACTION:
    description: "Action to perform for the pipeline."
    value: "build-image"
    options:
      - "build-image"
build-image:
  stage: build
  image: ghcr.io/blue-build/cli:latest-alpine
  retry: 2
  rules:
    - if: $ACTION == "build-image"
  parallel:
    matrix:
      - RECIPE:
          - recipe.yml
  id_tokens:
    SIGSTORE_ID_TOKEN:
      aud: sigstore
  script:
    - bb build --push ./config/$RECIPE

Support was also added for building in GitHub! You can use this tool instead of the standard GitHub Actions by using the following .github/workflows/build.yaml:

name: build-ublue
on:
  schedule:
    - cron: "30 16 * * *"
  push:
    branches:
      - live
      - template
      - main
    paths-ignore:
      - "**.md"
  pull_request:
  workflow_dispatch:
jobs:
  ublue-build:
    name: Build Ublue Image
    runs-on: ubuntu-22.04
    permissions:
      contents: read
      packages: write
      id-token: write
    strategy:
      fail-fast: false
      matrix:
        recipe:
          - recipe.yml
    steps:
      - name: Maximize build space
        uses: AdityaGarg8/remove-unwanted-software@v1
        with:
          remove-dotnet: 'true'
          remove-android: 'true'
          remove-haskell: 'true'
      - uses: actions/checkout@v4
      - uses: sigstore/cosign-installer@v3.3.0
      - name: Install Cargo
        run: |
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
      - name: Install BlueBuild tool
        run: |
          cargo install blue-build --locked
      - name: Install Dependencies
        run: |
          sudo apt-get install -y buildah skopeo
      - name: Build Image
        env:
          COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
          PR_EVENT_NUMBER: ${{ github.event.number }}
          REGISTRY_TOKEN: ${{ github.token }}
        run: |
          bb build --push ./config/${{ matrix.recipe }}

Future Features

  • Update to the most recent stable style of the starting point template
  • Setup pipeline automation for publishing
  • Create an init command to create a repo for you to start out
  • Setup the project to allow installing with binstall
  • Create an install script for easy install for users without cargo