chainguard-dev / melange

build APKs from source code
Apache License 2.0
411 stars 95 forks source link

Idea: melange init #177

Open imjasonh opened 1 year ago

imjasonh commented 1 year ago

It'd be cool to have a command to scaffold out a basic melange.yaml file. As a strawman, a basic melange init could emit a file containing:

package:
  name: TODO
  version: TODO
  epoch: 0
  description: TODO
  copyright:
    - license: TODO
  dependencies:
    runtime:
     # - TODO

environment:
  contents:
    repositories:
     # - TODO
    keyring:
     # - TODO
    packages:
     # - TODO

pipeline:
 # - name: TODO
 #   runs: TODO

This could be expanded with options like melange init --package-repo=alpine or wolfi, which would populate the .environment.contents.repositories and keyring with those values.

(If this sounds good we could also consider an apko init, with similar --package-repo flag, and a --nonroot flag to spit out the nonroot user boilerplate)

cc @eddiezane who actually had this idea

mritunjaysharma394 commented 1 year ago

Hi @imjasonh , I think I have worked on something similar earlier for another project and have an idea on how we can do this, so if this is not being worked on by someone else, I will try to do this as I myself am playing with melange and wolfi these days and I have to copy some or the other yaml to get boilerplate ready, would love to do this! thanks!

imjasonh commented 1 year ago

I think it's still worth doing! We also now have a lot more examples in the Wolfi repo, and wolfictl as a sandbox for features like this.

It might make sense to have wolfictl init <package> that sets up this boilerplate.

We could also do some Charm magic to build the YAML from common questions (source repo, language ecosystem to choose a template, etc)

cc @luhring

mritunjaysharma394 commented 1 year ago

Sounds great and interesting only, so probably we should do this for wolfictl itself? I will love to do that but Since melange’s one of the primary use cases are covered by Wolfi only should we implement here in melange too or just in wolfictl it should be good?

thanks a lot!