From d3ff4eed93ec0b23ef31476075fe8c5bb9683fa7 Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Sat, 30 Dec 2023 15:35:34 -0500 Subject: [PATCH] fix: rename ublue-rs to blue-build --- Cargo.lock | 40 ++++++++++++++++++------------------- Cargo.toml | 4 ++-- Earthfile | 20 +++++++++---------- src/bin/{ublue.rs => bb.rs} | 10 +++++----- src/lib.rs | 10 +--------- 5 files changed, 38 insertions(+), 46 deletions(-) rename src/bin/{ublue.rs => bb.rs} (86%) diff --git a/Cargo.lock b/Cargo.lock index ec7e0b1..58b3781 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,6 +107,26 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blue-build" +version = "0.3.8" +dependencies = [ + "anyhow", + "cfg-if", + "chrono", + "clap", + "clap-verbosity-flag", + "derive_builder", + "env_logger", + "log", + "rusty-hook", + "serde", + "serde_json", + "serde_yaml", + "tera", + "typed-builder", +] + [[package]] name = "bstr" version = "1.9.0" @@ -1075,26 +1095,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "ublue-rs" -version = "0.3.7" -dependencies = [ - "anyhow", - "cfg-if", - "chrono", - "clap", - "clap-verbosity-flag", - "derive_builder", - "env_logger", - "log", - "rusty-hook", - "serde", - "serde_json", - "serde_yaml", - "tera", - "typed-builder", -] - [[package]] name = "ucd-trie" version = "0.1.6" diff --git a/Cargo.toml b/Cargo.toml index 6c9a042..86f07f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "ublue-rs" -version = "0.3.7" +name = "blue-build" +version = "0.3.8" edition = "2021" description = "A CLI tool built for creating Containerfile templates based on the Ublue Community Project" repository = "https://gitlab.com/wunker-bunker/blue-build" diff --git a/Earthfile b/Earthfile index b0ee791..8336e8a 100644 --- a/Earthfile +++ b/Earthfile @@ -3,7 +3,7 @@ IMPORT github.com/earthly/lib/rust AS rust ARG --global FEDORA_MAJOR_VERSION=38 -ARG --global IMAGE=registry.gitlab.com/wunker-bunker/ublue-cli +ARG --global IMAGE=registry.gitlab.com/wunker-bunker/blue-build iso-generator: FROM registry.fedoraproject.org/fedora-toolbox:${FEDORA_MAJOR_VERSION} @@ -29,16 +29,16 @@ install: ARG --required TARGET DO rust+CARGO --args="build --release --target $TARGET" --output="$TARGET/release/[^\./]+" - SAVE ARTIFACT target/$TARGET/release/ublue + SAVE ARTIFACT target/$TARGET/release/bb -ublue-cli: +blue-build-cli: FROM registry.fedoraproject.org/fedora-toolbox:${FEDORA_MAJOR_VERSION} BUILD +install --TARGET="x86_64-unknown-linux-gnu" RUN dnf install --refresh -y buildah podman skopeo COPY +cosign/cosign /usr/bin/cosign - COPY (+install/ublue --TARGET="x86_64-unknown-linux-gnu") /usr/bin/ublue + COPY (+install/bb --TARGET="x86_64-unknown-linux-gnu") /usr/bin/bb ARG TAG IF [ "$TAG" != "" ] @@ -50,17 +50,17 @@ ublue-cli: SAVE IMAGE --push $IMAGE:latest END ELSE - SAVE IMAGE ublue-cli + SAVE IMAGE blue-build END -ublue-cli-alpine: +blue-build-cli-alpine: FROM alpine BUILD +install --TARGET="x86_64-unknown-linux-musl" RUN apk update && apk add buildah podman skopeo fuse-overlayfs COPY +cosign/cosign /usr/bin/cosign - COPY (+install/ublue --TARGET="x86_64-unknown-linux-musl") /usr/bin/ublue + COPY (+install/bb --TARGET="x86_64-unknown-linux-musl") /usr/bin/bb ARG TAG IF [ "$TAG" != "" ] @@ -72,10 +72,10 @@ ublue-cli-alpine: SAVE IMAGE --push $IMAGE:alpine END ELSE - SAVE IMAGE ublue-cli:alpine + SAVE IMAGE blue-build:alpine END all: - BUILD +ublue-cli - BUILD +ublue-cli-alpine + BUILD +blue-build + BUILD +blue-build-alpine BUILD +iso-generator diff --git a/src/bin/ublue.rs b/src/bin/bb.rs similarity index 86% rename from src/bin/ublue.rs rename to src/bin/bb.rs index 05922bb..f4523a4 100644 --- a/src/bin/ublue.rs +++ b/src/bin/bb.rs @@ -1,15 +1,15 @@ +use blue_build::{self, build, template}; use clap::{Parser, Subcommand}; use clap_verbosity_flag::{InfoLevel, Verbosity}; use env_logger::WriteStyle; use log::trace; -use ublue_rs::{self, build, template}; #[cfg(feature = "init")] -use ublue_rs::init; +use blue_build::init; #[derive(Parser, Debug)] -#[command(name = "Ublue Builder", author, version, about, long_about = None)] -struct UblueArgs { +#[command(name = "BlueBuild", author, version, about, long_about = None)] +struct BlueBuildArgs { #[command(subcommand)] command: CommandArgs, @@ -35,7 +35,7 @@ enum CommandArgs { } fn main() { - let args = UblueArgs::parse(); + let args = BlueBuildArgs::parse(); env_logger::builder() .filter_level(args.verbosity.log_level_filter()) diff --git a/src/lib.rs b/src/lib.rs index 6f95b1d..9f80024 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,4 @@ -//! The root library for ublue-rs. -//! -//! This module consists of the args for the cli as well as the -//! initial entrypoint for setting up tera to properly template -//! the Containerfile. There is support for legacy starting point -//! recipes using the feature flag 'legacy' and support for the newest -//! starting point setup using the 'modules' feature flag. You will not want -//! to use both features at the same time. For now the 'legacy' feature -//! is the default feature until modules works 1-1 with ublue starting point. +//! The root library for blue-build. #[cfg(feature = "init")] pub mod init;