Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: rename bb to bluebuild #50

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
.sccache/
.vscode/

# Local testing for bb recipe files
# Local testing for bluebuild recipe files
/config/
16 changes: 8 additions & 8 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"]
Expand All @@ -122,28 +122,28 @@ 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

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
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <CONTAINERFILE> <RECIPE_FILE>
bluebuild 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`
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`.
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -157,7 +157,7 @@ build-image:
SIGSTORE_ID_TOKEN:
aud: sigstore
script:
- bb build --push ./config/$RECIPE
- bluebuild build --push ./config/$RECIPE
```

## Future Features
Expand Down
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

File renamed without changes.
4 changes: 2 additions & 2 deletions src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand All @@ -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))]
Expand Down
2 changes: 1 addition & 1 deletion src/commands/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl BlueBuildCommand for CompletionsCommand {
generate(
self.shell,
&mut BlueBuildArgs::command(),
"bb",
"bluebuild",
&mut std::io::stdout().lock(),
);

Expand Down
2 changes: 1 addition & 1 deletion templates/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down