munki / munki-pkg

Repo for the munkipkg tool and example projects
Other
343 stars 75 forks source link

Feature request: Ability to run prebuild/postbuild scripts #73

Closed homebysix closed 1 month ago

homebysix commented 1 month ago

Sometimes there are steps in the package building process that require creating something dynamic within the payload. For such situations, it would simplify our workflow to be able to provide a script that runs before or after package building. Such a script could be provided in a file at scripts/prebuild or scripts/postbuild in the MunkiPkg project.

An example of a useful prebuild script would be one that runs swiftc to compile a binary and cp it into the payload before building.

An example of a useful postbuild script would be one that runs aws s3 cp to send the latest built pkg to an S3 bucket.

gregneagle commented 1 month ago

Not something I plan to work on myself (as I don't really have a need). This feels a bit like trying to evolve munki-pkg in the same direction as AutoPkg....

erikng commented 1 month ago

Or just make a script that does that? That's what nudge does to customize what is necessary for it prior to invoking munkipkg and post actions.

gregneagle commented 1 month ago

Sure. A wrapper script around munkipkg could do this sort of thing as well.

erikng commented 1 month ago

I think complicating Munki-pkg for this doesn't make sense and will just result in more code that Greg has to maintain.

A wrapper seems like the better approach for your unique needs.

homebysix commented 1 month ago

Yep, that's what we've been doing. Understood, best to keep things simple in this project.