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

feat: snippets #51

Merged
merged 4 commits into from
Feb 7, 2024
Merged

feat: snippets #51

merged 4 commits into from
Feb 7, 2024

Conversation

bayou-brogrammer
Copy link
Collaborator

@bayou-brogrammer bayou-brogrammer commented Feb 7, 2024

Goals

This PR adds snippets which is being discussed in #41 .

It will generate snippet lines for ONLY our containerfile module

  • allow for modules to specify snippets
  • append snippets to module run inside Containerfile
  • write supporting test

Preview

Recipe.yml

# image will be published to ghcr.io/<user>/<name>
name: orora

description: A starting point for further customization of uBlue images. Make your own! https://ublue.it/making-your-own/

base-image: ghcr.io/ublue-os/silverblue-main
image-version: latest # latest is also supported if you want new updates ASAP

modules:
  - type: signing
    snippets:
      - COPY --from=ghcr.io/blue-build/cli:latest-installer /out/BLUEBUILD /usr/bin/BLUEBUILD

Generated Container File snippet

RUN chmod +x /tmp/modules/signing/signing.sh && source /tmp/exports.sh && /tmp/modules/signing/signing.sh '{"type":"signing","snippets":["COPY --from=ghcr.io/blue-build/cli:latest-installer /out/BLUEBUILD /usr/bin/BLUEBUILD"]}'
COPY --from=ghcr.io/blue-build/cli:latest-installer /out/BLUEBUILD /usr/bin/BLUEBUILD

@bayou-brogrammer bayou-brogrammer added type: feature Brand new functionality, features, pages, workflows, endpoints, etc. type: discussion Questions, proposals and info that requires discussion. labels Feb 7, 2024
@bayou-brogrammer bayou-brogrammer added this to the 🚀 V1 Release 🚀 milestone Feb 7, 2024
@bayou-brogrammer bayou-brogrammer linked an issue Feb 7, 2024 that may be closed by this pull request
@bayou-brogrammer bayou-brogrammer self-assigned this Feb 7, 2024
Copy link
Member

@gmpinder gmpinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further discussions still need to be had for how to support this and for which modules:

#41

@xynydev
Copy link
Member

xynydev commented Feb 7, 2024

I added my comment in #41 alongside some concerned questions on Discord, but here's more of a PR review:

  • What's the usecase of adding snippets through the signing module? I understand this PR supports any module for snippets. Why, what's the benefit?
  • Even if there is a benefit, it doesn't make sense to me to add another default key to the module configuration that isn't related to the modules functionality at all.
  • This PR might be fine, though, if you refactor it to just work with the pre-existing containerfile module.

src/commands/template.rs Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
gmpinder
gmpinder previously approved these changes Feb 7, 2024
src/commands/template.rs Outdated Show resolved Hide resolved
@bayou-brogrammer bayou-brogrammer enabled auto-merge (squash) February 7, 2024 18:03
@bayou-brogrammer bayou-brogrammer merged commit 0d8fd93 into main Feb 7, 2024
1 check passed
@bayou-brogrammer bayou-brogrammer deleted the snippets branch February 7, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: discussion Questions, proposals and info that requires discussion. type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should we provide modules that allow running commands directly?
3 participants