Commit graph

52 commits

Author SHA1 Message Date
Gerald Pinder
367359e8ea
fix: Better support distrobox (#160)
We will now have a dedicated alpine based `distrobox` image. Due to
restrictions in how the `/tmp` directory in a `distrobox` image works,
it will not play nicely with generating a local tarball for rebasing a
locally built image. Going further into fixing this would required a
rootful setup and I'd rather leave the `distrobox` method as an easy way
to try out building a recipe for users who are not booted on a
`bluebuild` image.

Extra packages are installed to make the `distrobox` setup quicker and a
`distrobox.ini` file is provided to easily create the container and
export the CLI for use on the host machine. The `podman` binary is
passed into the `distrobox` container so that all images that are built
will be accessible locally and allows rootless operation without extra
setup.
2024-11-24 11:50:38 -05:00
Gerald Pinder
69851a5384 fix: Pin prebuilds to Fedora 40 2024-11-01 16:21:05 -04:00
Gerald Pinder
9a3ad0ae17 feat: Add validation command 2024-10-30 18:08:50 -04:00
Gerald Pinder
32092195d3
chore: Cleanup workflows to be run from just (#238) 2024-10-07 16:34:36 -04:00
Gerald Pinder
37a69df832 ci: Run clippy and test for every feature individually 2024-09-28 22:40:12 -04:00
Gerald Pinder
f13b67637b fix: Make sure getting version fails if not all dirs were copied 2024-08-20 09:53:59 -04:00
Gerald Pinder
8ce83ba7ff
refactor: Create SigningDriver and CiDriver (#197)
This also includes a new `login` command. The signing and CI logic is now using the Driver trait system along with a new experimental sigstore signing driver. New static macros have also been created to make implementation management easier for `Command` usage and `Driver` trait implementation calls.

---------

Co-authored-by: xyny <60004820+xynydev@users.noreply.github.com>
2024-08-12 23:52:07 -04:00
Gerald Pinder
3ecb0d3d93 chore: Fix tag CI to build prebuild separately from main build 2024-08-11 12:06:31 -04:00
Gerald Pinder
7a563f42da
fix: Support other signals properly (#194) 2024-06-23 18:29:46 -04:00
Gerald Pinder
c12deec589 chore: Use proper out directory for installer image 2024-06-10 09:27:01 -04:00
Gerald Pinder
6945915d4e
feat: Add arm support (#191)
This adds support for ARM based images and binaries.
2024-06-04 14:03:00 -04:00
Gerald Pinder
8069006c03
feat: Stages (#173)
## Stages

A new property (`stages`) is being added to the recipe file schema. 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

Currently the only modules that work out-of-the-box are `copy`,
`script`, `files`, and `containerfile`. Other modules are dependent on
the programs installed on the image. In order to better support some of
our essential modules, a setup script is ran at the start of each stage
that is not `scratch`. This script will install `curl`, `wget`, `bash`,
and `grep` and use the package manager for the detected distributions.

At this time, the following distributions are supported:

- Debian
- Ubuntu
- Fedora
- Alpine

Contributions to increase the size of this list is
[welcome](https://github.com/blue-build/cli)!

### Syntax

- **Required**
- `from` - The full image ref (image name + tag). This will be set in
the `FROM` statement of the stage.
- `name` - The name of the stage. This is used when referencing the
stage when using the `from:` property in the `copy` module.
- `modules` - The list of modules to execute. The exact same syntax used
by the main recipe `modules:` property.
- **Optional**
- `shell` - Allows a user to pass in an array of strings that are passed
directly into the [`SHELL`
instruction](https://docs.docker.com/reference/dockerfile/#shell).

#### Example

```yaml
stages:
- name: ubuntu-test
  from: ubuntu
  modules:
  - type: files
    files:
    - usr: /usr
  - type: script
    scripts:
    - example.sh
    snippets:
    - echo "test" > /test.txt
  - type: test-module
  - type: containerfile
    containerfiles:
    - labels
    snippets:
    - RUN echo "This is a snippet"
```

### Tasks
- [x] `from-file:` - Allows the user to store their stages in a separate
file so it can be included in multiple recipes
- [x] `no-cache:` - This will be useful for stages that want to pull the
latest changes from a git repo and not have to rely on the base image
getting an update for the build to be triggered again.
- [x] Add setup script to be able to install necessary programs to run
`bluebuild` modules in stages
- [x] Check for circular dependencies and error out

## `copy` module

This is a 1-1 for the [`COPY`
instruction](https://docs.docker.com/reference/dockerfile/#copy). It has
the ability to copy files between stages, making this a very important
addition to complete functionality for the stages feature. Each use of
this "module" will become its own layer.

### Decision to use `--link`

We use the `--link`
[option](https://docs.docker.com/reference/dockerfile/#benefits-of-using---link)
which allows that layer to have the same hash if the files haven't
changed regardless of if the previous instructions have changed. This
allows these layers to not have to be re-downloaded on the user's
computer if the copied files haven't changed.

### Syntax

- **Required**
- `src` - The source directory/file from the repo OR when `from:` is set
the image/stage that is specified.
  - `dest` - The destination directory/file inside the working image.
- **Optional**
  - `from` - The stage/image to copy from.

#### Example

```yaml
modules:
- type: copy
  from: ubuntu-test
  src: /test.txt
  dest: /
```

### Tasks
- [x] make `from:` optional
- [x] Add README.md and module.yml

## Feature gating

Gating this feature until we release for `v0.9.0`. The plan will be to
build all features (including this one) for main branch builds. This
means that these features will be available when using the `main` image
and consequently the `use_unstable_cli:` option on the GitHub Action.
All future `v0.9.0` features will be gated as well to allow for patches
to `v0.8`.

### Tasks
- [x] Build `--all-features` on non-tagged builds
- [x] Add stages and copy features
2024-05-18 13:23:50 +00:00
Gerald Pinder
2923c417ab chore: Ensure cargo installs use version for build scripts image 2024-05-07 20:16:22 -04:00
Gerald Pinder
c2abf3fcb8
fix: Git sha not present during cargo install (#176) 2024-05-05 00:44:22 -04:00
Gerald Pinder
bb5fbdd193 chore: Fix how we get the version in the Earthfile 2024-04-30 16:41:12 -04:00
Gerald Pinder
ac57f9e9f5 chore: Streamline getting version 2024-04-29 23:40:11 -04:00
Gerald Pinder
83d654d3a2 chore: Improve tagging of images and applying labels 2024-04-28 21:21:54 -04:00
Gerald Pinder
0c7033ccd2
feat: Move module run logic into its own script (#168)
This will help make the Containerfile just a little bit easier to read
(ignoring all the mounts lol). This would also allow us to add logic
later to support modules that run executables other than `*.sh`.
2024-04-27 15:19:58 -04:00
Gerald Pinder
e66e880857
chore: Cleanup images and use hash for exports tag (#158)
I noticed that making changes to the exports script before a release
could cause modules to not build properly if breaking changes got pushed
out. To prevent this, I'm making it so that the hash of the commit is
put in the tag for the exports script image and that the CLI tool will
use that hash when building the `Containerfile`.
2024-04-13 05:55:50 +00:00
Gerald Pinder
198886c799 chore: Use tag exports instead 2024-03-27 00:33:31 -04:00
Gerald Pinder
72e961c572 chore: Add image source label for exports 2024-03-27 00:27:58 -04:00
Gerald Pinder
19c93ce742 fix: Put export script in own image
HEREDOC support for podman doesn't work exactly 1-1 with Dockerfiles. This fix gives the export script its own image that we mount.
2024-03-27 00:08:58 -04:00
Gerald Pinder
da628db1ee chore: Remove builtin-podman code
This was not being worked on and was becoming too much trouble for our current goals
2024-03-23 15:54:15 -04:00
Gerald Pinder
338b9c699e chore: Separate nightly build to not run in CI for now 2024-03-19 22:39:25 -04:00
Gerald Pinder
27dfdbc8a7 chore: Don't build nightly for now 2024-03-19 19:39:24 -04:00
Gerald Pinder
3a2353923d chore: Update builds to use different satellites and have integration tests on their own job 2024-03-06 15:08:16 -05:00
Gerald Pinder
0ba78fab32
refactor: Update build command to use BuildStrategy (#88) 2024-03-01 11:18:02 -06:00
Gerald Pinder
910e0434b6
refactor: Move templates to their own crate (#83)
This PR logically separates out parts of the code to their own crates. This will be useful for future Tauri App development.
2024-02-25 14:45:33 -06:00
gerblesh
d26382b85f
feat: use WORKDIR and ENTRYPOINT for cli containers (#63)
required for running the bluebuild CLI directly from podman (needed for
latest version of bluebuild for github action)

---------

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
2024-02-14 16:40:17 +00:00
Gerald Pinder
46700ab794
chore: Create base integration test setup (#55)
This will allow us to create a suite of tests for our new features
rather than using my personal image repo
2024-02-09 11:47:59 -05:00
Hikari
2492bb0eee
refactor!: rename bb to bluebuild (#50) 2024-02-06 19:55:38 -05:00
Gerald Pinder
933d25054a fix: Build failing due to change in local tarball location 2024-02-01 11:27:53 -05:00
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
Gerald Pinder
39fce7b2f9 fix: Use new cargo-builder to help speed up build times 2024-01-28 18:58:47 -05:00
Gerald Pinder
cd1e43b0c3
chore: Setup earthly satellite building (#29)
- Builds on main and tags will use the `medium` satellite that uses `x4`
rate on build minutes
  - This gives us larger cache and more memory
- Builds on PRs will use the `small` satellite that uses `x2` rate on
build minutes
- We are using the starter tier which gives us `10000` build minutes per
month and caching for our builds to make them faster
2024-01-28 13:20:13 -06:00
Gerald Pinder
097dbb391a
fix: Improve workflow for main branch and PRs (#17)
This makes it so that the main branch will push images but PRs won't.
This also puts integration tests back in the `+all` target.
2024-01-27 11:44:54 -06:00
Gerald Pinder
e8e8bfa096 ci: Allow write for contents and id-token 2024-01-23 22:03:33 -05:00
Gerald Pinder
6a4c89d567 ci: Don't build integration tests in +all 2024-01-23 21:49:13 -05:00
N16hth4wk
99649d2d88
ci: Create GitHub Workflow (#9)
Add support for building, tagging, and releasing via CICD

---------

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
2024-01-23 20:07:48 -05:00
Gerald Pinder
b547a326fd feat!: Upgrade and Rebase commands 2024-01-21 23:23:36 +00:00
Gerald Pinder
1b950b08dc nightly(podman-api): Use podman-api crate for building images 2024-01-19 18:55:26 +00:00
Gerald Pinder
218cc9c7d3 ci: use --privileged instead of WITH DOCKER 2024-01-14 22:20:52 -05:00
Gerald Pinder
5d50ac4fef ci: Run both nightly and default integration tests 2024-01-14 22:02:36 -05:00
Gerald Pinder
9636c2edc5 test: Add integration tests for build and template 2024-01-15 02:20:08 +00:00
Gerald Pinder
eaeb79f329 feat: Local image rebasing 2024-01-14 03:02:35 +00:00
Gerald Pinder
e0d93e81b5 fix: Earthfile syntax error 2023-12-30 15:53:18 -05:00
Gerald Pinder
d3ff4eed93 fix: rename ublue-rs to blue-build 2023-12-30 15:35:34 -05:00
Gerald Pinder
3b07758709 fix: add support for alpine image and using either podman or buildah 2023-12-28 16:28:34 -05:00
Gerald Pinder
a25e0418c4 Add ability to use incremental caching for rust builds in Earthfile 2023-12-27 16:36:16 -05:00
Gerald Pinder
a3da7e3db0 Have ublue-cli manage iso-generator 2023-12-21 18:06:00 -05:00