Commit graph

342 commits

Author SHA1 Message Date
Gerald Pinder
abedf4fc6b
fix: Use leniency for semver parsing (#184) 2024-05-16 20:15:14 -04:00
Gerald Pinder
e6905b4fcc chore: Fix checkout for podman-build 2024-05-15 11:35:20 -04:00
Gerald Pinder
2cb6d1e00c Remove if for main build 2024-05-15 10:23:12 -04:00
Gerald Pinder
c472fad2af Add podman build job 2024-05-15 10:02:37 -04:00
Gerald Pinder
73f219d4ca fix: Don't create builder if DOCKER_HOST is set 2024-05-14 13:50:33 -04:00
Gerald Pinder
a2ca8c6fc9 docs: Update docker/podman install instructions 2024-05-14 10:58:12 -04:00
Gerald Pinder
3a8d361d4e docs: Update README to revert cargo install instruction since issue is fixed 2024-05-14 10:50:49 -04:00
Gerald Pinder
eddbcb48f7 chore: Release 2024-05-14 10:14:54 -04:00
Gerald Pinder
a3c5b6f06b fix: Create lock on docker setup to prevent race conditions 2024-05-14 10:14:04 -04:00
Gerald Pinder
33f0ff1bfa fix: Don't use '' in format arg 2024-05-12 15:34:16 -04:00
Gerald Pinder
6600d170af feat: Create a bluebuild buildx runner 2024-05-12 13:19:15 -04:00
Gerald Pinder
4374b5f941 fix: Make docker pull latest images when building
This will help with instances where the image was cached already.
2024-05-12 12:03:10 -04:00
Gerald Pinder
f7904e4bde chore: Cleanup install script to instead create the container without running it 2024-05-12 11:47:11 -04:00
Gerald Pinder
2923c417ab chore: Ensure cargo installs use version for build scripts image 2024-05-07 20:16:22 -04:00
Gerald Pinder
55c1b087f7 fix: Add driver args to rebase/upgrade command 2024-05-06 16:53:43 -04:00
Gerald Pinder
5786ce40bf chore: Release 2024-05-05 01:18:08 -04:00
Gerald Pinder
50088db096 chore: Fix release replacements 2024-05-05 01:17:49 -04:00
Gerald Pinder
7ce0ad7cf8
chore: Remove title case (#177) 2024-05-05 00:47:54 -04:00
Gerald Pinder
c2abf3fcb8
fix: Git sha not present during cargo install (#176) 2024-05-05 00:44:22 -04:00
Gerald Pinder
ad7a0f075e chore: Allow tests to pass due to upstream akmods issues 2024-05-05 00:09:09 -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
6c940ea8cd
feat: Add alternate tags for user images (#172)
This adds the ability for the user to add alternate tags to their
images. These are designed to replace the `latest` and timestamp (e.g.
`20240429`) tags.
2024-04-30 09:51:05 -04:00
Gerald Pinder
ac57f9e9f5 chore: Streamline getting version 2024-04-29 23:40:11 -04:00
Gerald Pinder
cfc39817fc chore: Release 2024-04-28 21:56:24 -04:00
Gerald Pinder
83d654d3a2 chore: Improve tagging of images and applying labels 2024-04-28 21:21:54 -04:00
Gerald Pinder
0b5e7599f8 fix: Fix flatpak module errors 2024-04-28 18:56:11 -04:00
Gerald Pinder
76d32bc23a chore: Fix integration tests 2024-04-28 00:36:45 -04:00
Gerald Pinder
232795a932 chore: Pull version using cargo for tag job 2024-04-27 15:41:55 -04:00
Gerald Pinder
d4160fedd9 chore: Remove token from checkout 2024-04-27 15:28:43 -04:00
Gerald Pinder
fbbd2d220a chore: Release 2024-04-27 15:21:48 -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
3898202bc3
fix: Pull extra akmods image too (#169)
Adds the new `-extra` image from akmods image
2024-04-27 15:01:06 -04:00
Gerald Pinder
92150693d4
feat: Display full recipe with syntax highlighting (#166)
As I was re-arranging my recipe files, I needed a way to ensure that the
order of my recipe is correct without having to read through the
generated `Containerfile`. So I added a `-d`/`--display-full-recipe` arg
to `template` that will print out all of your modules in the order
defined by following the `from-file` property.

```
$> bluebuild template --help
Generate a Containerfile from a recipe

Usage: bluebuild template [OPTIONS] [RECIPE]

Arguments:
  [RECIPE]
          The recipe file to create a template from

Options:
  -o, --output <OUTPUT>
          File to output to instead of STDOUT

      --registry <REGISTRY>
          The registry domain the image will be published to.

          This is used for modules that need to know where the image is being published (i.e. the signing module).

      --registry-namespace <REGISTRY_NAMESPACE>
          The registry namespace the image will be published to.

          This is used for modules that need to know where the image is being published (i.e. the signing module).

  -d, --display-full-recipe
          Instead of creating a Containerfile, display the full recipe after traversing all `from-file` properties.

          This can be used to help debug the order you defined your recipe.

  -t, --syntax-theme <SYNTAX_THEME>
          Choose a theme for the syntax highlighting for the Containerfile or Yaml.

          The default is `mocha-dark`.

          [possible values: mocha-dark, ocean-dark, ocean-light, eighties-dark, inspired-github, solarized-dark, solarized-light]

  -s, --squash
          Puts the build in a `squash-stage` and COPY's the results to the final stage as one layer.

          WARN: This doesn't work with the docker driver as it has been deprecated.

          NOTE: Squash has a performance benefit for the newer versions of podman and buildah.

  -B, --build-driver <BUILD_DRIVER>
          Select which driver to use to build your image

          [possible values: buildah, podman, docker]

  -v, --verbose...
          Increase logging verbosity

  -I, --inspect-driver <INSPECT_DRIVER>
          Select which driver to use to inspect images

          [possible values: skopeo, podman, docker]

  -q, --quiet...
          Decrease logging verbosity

  -h, --help
          Print help (see a summary with '-h')
```

Preview of Containerfile/Dockerfile syntax highlighting:

![image](https://github.com/blue-build/cli/assets/4626052/cf2c452e-94b1-44f3-97ca-162d50a5047f)

Preview of Yaml highlighting:

![image](https://github.com/blue-build/cli/assets/4626052/b7c48b82-3e9e-431c-a55b-679848cd1fa6)
2024-04-27 09:12:04 -04:00
Gerald Pinder
a7503d561e chore: Make more /var dirs 2024-04-24 23:35:33 -04:00
Gerald Pinder
2bf7c99aaf chore: Use Semver to grab OS version from image 2024-04-24 22:42:44 -04:00
Gerald Pinder
1d05290266 chore: Remove debug logs from utils 2024-04-24 21:16:09 -04:00
Gerald Pinder
29efd47733 chore: Fix tag.yml workflow to pull version from .workspace.package.version 2024-04-22 17:14:01 -04:00
Gerald Pinder
8d140724ae fix: Use shebang in release recipe 2024-04-22 17:07:40 -04:00
Gerald Pinder
8f811200aa chore: Release 2024-04-22 16:50:07 -04:00
Gerald Pinder
c599138982 chore: Prepare justfile for release 2024-04-22 16:49:47 -04:00
Gerald Pinder
71a3bda3c3
chore: Update akmods module to account for upstream changes (#165)
This change updates the akmods module to pull the new nvidia images. The
new property will be a boolean with property name of `nvidia`. If a user
continues to use the old `nvidia-version` property, a warning will be
printed telling them to switch to the new property. The old images will
still be allowed to be used to support backwards compatibility.
2024-04-20 13:00:38 -04:00
Gerald Pinder
4ef0bf9169 fix: Give better errors for read_to_string 2024-04-16 17:34:04 -04:00
Gerald Pinder
7c4c6759ca fix: Create /var/lib/alternatives 2024-04-16 17:17:48 -04:00
Gerald Pinder
9fb2aa1eb9 fix: Create /var/roothome to fix any issues with adding files to /root 2024-04-16 15:02:42 -04:00
Gerald Pinder
2c1d1b9473 fix: Remove /var tmpfs 2024-04-16 13:13:37 -04:00
Gerald Pinder
1b32275a33
fix: Error if any module fails to deserialize (#163)
Previous implementation wasn't taking into account the modules failing
to be read properly and were just being ignored. This changes that to
error out if any `from-file:` usage doesn't deserialize properly.
2024-04-15 09:22:25 -04:00
Gerald Pinder
ff05976917
fix: Add test for rpm-ostree rebase (#161)
Adding this so that we can make sure that `rpm-ostree rebase` tests the
arguments passed in.
2024-04-14 22:59:32 -04:00
Gerald Pinder
f8b7334662
feat: Look for recipes in ./recipes/, build files in ./files/, and Containerfiles in ./containerfiles/ (#157)
Recipe files can now be put into their own directory `./recipes/`. This
directory is NEVER copied into the build so changes to a recipe will no
longer cause cache misses for builds. Here is an example of my build
changing the second to last module and only requiring the last 2 `RUN`
layers to be run again.

```
 => CACHED [stage-config 1/1] COPY ./config /config                                                                                                       0.0s
 => CACHED [stage-modules 1/2] COPY --from=ghcr.io/blue-build/modules:latest /modules /modules                                                            0.0s
 => CACHED [stage-modules 2/2] COPY ./modules /modules                                                                                                    0.0s
 => CACHED [stage-keys 1/1] COPY cosign.pub /keys/jp-desktop-gaming.pub                                                                                   0.0s
 => CACHED [stage-4  2/16] RUN --mount=type=bind,from=stage-keys,src=/keys,dst=/tmp/keys   mkdir -p /usr/etc/pki/containers/   && cp /tmp/keys/* /usr/et  0.0s
 => CACHED [stage-bins 1/3] COPY --from=gcr.io/projectsigstore/cosign /ko-app/cosign /bins/cosign                                                         0.0s
 => CACHED [stage-bins 2/3] COPY --from=docker.io/mikefarah/yq /usr/bin/yq /bins/yq                                                                       0.0s
 => CACHED [stage-bins 3/3] COPY --from=ghcr.io/blue-build/cli:main-installer /out/bluebuild /bins/bluebuild                                              0.0s
 => CACHED [stage-4  3/16] RUN --mount=type=bind,from=stage-bins,src=/bins,dst=/tmp/bins   mkdir -p /usr/bin/   && cp /tmp/bins/* /usr/bin/   && ostree   0.0s
 => CACHED [stage-4  4/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4  5/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4  6/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4  7/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4  8/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4  9/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4 10/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4 11/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4 12/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4 13/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => CACHED [stage-4 14/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind  0.0s
 => [stage-4 15/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind,from=  33.4s
 => [stage-4 16/16] RUN   --mount=type=tmpfs,target=/var   --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw   --mount=type=bind,from=s  0.7s
```

Support was also added to put all build files into `./files/` instead of
`./config/`. This is an all or nothing operation, meaning if there
exists a directory of `files` then the `config` directory will be
completely ignored. Work will have to be done in
https://github.com/blue-build/modules to allow users to put their files
directly in `./files/` and not `./files/files` for the `files` module or
`./files/scripts` for the scripts module.

Support was also added to move the `./config/containerfiles/` directory
to the root of the project. Now the directories you can find in the root
of projects are:

```
files/
containerfiles/
recipes/
```
2024-04-13 19:08:31 +00: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
b5cca98676 chore: Put LABELS last since they cause cache miss with buildah 2024-04-11 17:21:22 -04:00