From 2492bb0eee9abeca6d5a91f7c636dc2524e9f47e Mon Sep 17 00:00:00 2001 From: Hikari Date: Tue, 6 Feb 2024 18:55:38 -0600 Subject: [PATCH] refactor!: rename bb to bluebuild (#50) --- .gitignore | 2 +- Earthfile | 16 ++++++++-------- README.md | 14 +++++++------- install.sh | 6 +++--- src/bin/{bb.rs => bluebuild.rs} | 0 src/commands/build.rs | 4 ++-- src/commands/completions.rs | 2 +- templates/Containerfile | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) rename src/bin/{bb.rs => bluebuild.rs} (100%) diff --git a/.gitignore b/.gitignore index b4f691c..c714a0e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ .sccache/ .vscode/ -# Local testing for bb recipe files +# Local testing for bluebuild recipe files /config/ diff --git a/Earthfile b/Earthfile index c1b9117..0ae1ec1 100644 --- a/Earthfile +++ b/Earthfile @@ -55,7 +55,7 @@ install: DO cargo+BUILD_RELEASE --BUILD_TARGET=$BUILD_TARGET --NIGHTLY=$NIGHTLY - SAVE ARTIFACT target/$BUILD_TARGET/release/bb + SAVE ARTIFACT target/$BUILD_TARGET/release/bluebuild common: FROM ghcr.io/blue-build/earthly-lib/cargo-builder @@ -79,7 +79,7 @@ blue-build-cli: COPY +cosign/cosign /usr/bin/cosign - COPY (+install/bb --BUILD_TARGET="x86_64-unknown-linux-gnu" --NIGHTLY=$NIGHTLY) /usr/bin/bb + COPY (+install/bluebuild --BUILD_TARGET="x86_64-unknown-linux-gnu" --NIGHTLY=$NIGHTLY) /usr/bin/bluebuild ARG TAG ARG LATEST=false @@ -94,7 +94,7 @@ blue-build-cli-alpine: RUN apk update && apk add buildah podman skopeo fuse-overlayfs COPY +cosign/cosign /usr/bin/cosign - COPY (+install/bb --BUILD_TARGET="x86_64-unknown-linux-musl" --NIGHTLY=$NIGHTLY) /usr/bin/bb + COPY (+install/bluebuild --BUILD_TARGET="x86_64-unknown-linux-musl" --NIGHTLY=$NIGHTLY) /usr/bin/bluebuild ARG TAG ARG LATEST=false @@ -105,7 +105,7 @@ installer: ARG NIGHTLY=false BUILD +install --BUILD_TARGET="x86_64-unknown-linux-gnu" --NIGHTLY=$NIGHTLY - COPY (+install/bb --BUILD_TARGET="x86_64-unknown-linux-gnu" --NIGHTLY=$NIGHTLY) /out/bb + COPY (+install/bluebuild --BUILD_TARGET="x86_64-unknown-linux-gnu" --NIGHTLY=$NIGHTLY) /out/bluebuild COPY install.sh /install.sh CMD ["cat", "/install.sh"] @@ -122,7 +122,7 @@ integration-test-template: integration-test-template-containerfile: ARG NIGHTLY=false FROM +integration-test-base --NIGHTLY=$NIGHTLY - RUN bb -vv template config/recipe-jp-desktop.yml | tee Containerfile + RUN bluebuild -vv template config/recipe-jp-desktop.yml | tee Containerfile SAVE ARTIFACT /test @@ -130,20 +130,20 @@ integration-test-build: ARG NIGHTLY=false FROM +integration-test-base --NIGHTLY=$NIGHTLY - RUN --privileged bb -vv build config/recipe-jp-desktop.yml + RUN --privileged bluebuild -vv build config/recipe-jp-desktop.yml integration-test-rebase: ARG NIGHTLY=false FROM +integration-test-base --NIGHTLY=$NIGHTLY - RUN --privileged bb -vv rebase config/recipe-jp-desktop.yml + RUN --privileged bluebuild -vv rebase config/recipe-jp-desktop.yml integration-test-upgrade: ARG NIGHTLY=false FROM +integration-test-base --NIGHTLY=$NIGHTLY RUN mkdir -p /etc/bluebuild && touch /etc/bluebuild/jp-desktop.tar.gz - RUN --privileged bb -vv upgrade config/recipe-jp-desktop.yml + RUN --privileged bluebuild -vv upgrade config/recipe-jp-desktop.yml integration-test-base: ARG NIGHTLY=false diff --git a/README.md b/README.md index a9e868f..61139e9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ BlueBuild's command line program that builds Containerfiles and custom images ba ### 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. +We package a `fedora-toolbox` and `alpine` image with all the tools needed to run `bluebuild`. You can use `distrobox` to run the application without needing to install it on your machine. ```bash distrobox create blue-build --image ghcr.io/blue-build/cli @@ -42,17 +42,17 @@ podman run --rm ghcr.io/blue-build/cli:latest-installer | bash Once you have the CLI tool installed, you can run the following to pull in your recipe file to generate a `Containerfile`. ```bash -bb template -o +bluebuild template -o ``` -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` +You can then use this with `podman` or `buildah` to build and publish your image. Further options can be viewed by running `bluebuild template --help` ### Building If you don't care about the details of the template, you can run the `build` command. ```bash -bb build ./config/recipe.yaml +bluebuild build ./config/recipe.yaml ``` This will template out the file and build with `buildah` or `podman`. @@ -64,7 +64,7 @@ This will template out the file and build with `buildah` or `podman`. 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. ```bash -sudo bb rebase config/recipe.yml +sudo bluebuild rebase config/recipe.yml ``` You can initiate an immediate restart by adding the `--reboot/-r` option. @@ -74,7 +74,7 @@ You can initiate an immediate restart by adding the `--reboot/-r` option. When you've rebased onto a local image archive, you can update your image for your recipe by running: ```bash -sudo bb upgrade config/recipe.yml +sudo bluebuild upgrade config/recipe.yml ``` The `--reboot` argument can be used with this command as well. @@ -157,7 +157,7 @@ build-image: SIGSTORE_ID_TOKEN: aud: sigstore script: - - bb build --push ./config/$RECIPE + - bluebuild build --push ./config/$RECIPE ``` ## Future Features diff --git a/install.sh b/install.sh index b1ca3c5..c3ff5a3 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ sudo podman run \ tail -f /dev/null set +e -sudo podman cp blue-build-installer:/out/bb /usr/local/bin/bb +sudo podman cp blue-build-installer:/out/bluebuild /usr/local/bin/bluebuild RETVAL=$? set -e @@ -33,8 +33,8 @@ if [ $RETVAL != 0 ]; then echo "Failed to copy file" exit 1 else - # sudo mv bb /usr/local/bin/ - echo "Finished! BlueBuild has been installed at /usr/local/bin/bb" + # sudo mv bluebuild /usr/local/bin/ + echo "Finished! BlueBuild has been installed at /usr/local/bin/bluebuild" cleanup fi diff --git a/src/bin/bb.rs b/src/bin/bluebuild.rs similarity index 100% rename from src/bin/bb.rs rename to src/bin/bluebuild.rs diff --git a/src/commands/build.rs b/src/commands/build.rs index 9ea8bb8..d35b718 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -114,7 +114,7 @@ pub struct BuildCommand { /// /// For example: /// - /// bb build --public-key env://PUBLIC_KEY ... + /// bluebuild build --public-key env://PUBLIC_KEY ... #[cfg(feature = "sigstore")] #[arg(long)] #[builder(default, setter(into, strip_option))] @@ -128,7 +128,7 @@ pub struct BuildCommand { /// /// For example: /// - /// bb build --private-key env://PRIVATE_KEY ... + /// bluebuild build --private-key env://PRIVATE_KEY ... #[cfg(feature = "sigstore")] #[arg(long)] #[builder(default, setter(into, strip_option))] diff --git a/src/commands/completions.rs b/src/commands/completions.rs index 2493023..4424fba 100644 --- a/src/commands/completions.rs +++ b/src/commands/completions.rs @@ -18,7 +18,7 @@ impl BlueBuildCommand for CompletionsCommand { generate( self.shell, &mut BlueBuildArgs::command(), - "bb", + "bluebuild", &mut std::io::stdout().lock(), ); diff --git a/templates/Containerfile b/templates/Containerfile index 8b0ed17..8695947 100644 --- a/templates/Containerfile +++ b/templates/Containerfile @@ -33,7 +33,7 @@ COPY --from=ghcr.io/blue-build/cli: {{ tag }} {%- else -%} latest-installer -{%- endif %} /out/bb /usr/bin/bb +{%- endif %} /out/bluebuild /usr/bin/bluebuild COPY config /tmp/config/