pro tip: use scriptlets instead of custom plugins

Kyle Fazzari kyle.fazzari at canonical.com
Mon Feb 20 17:33:02 UTC 2017


On Feb 20, 2017 9:14 AM, "Loïc Minier" <loic.minier at ubuntu.com> wrote:



On Mon, Feb 20, 2017 at 5:55 PM, Kyle Fazzari <kyle.fazzari at canonical.com>
wrote:

>
> - 'prepare' runs before build
> - 'build' replaces plugin build (including install)
> - 'install' runs after build. This is useful e.g. for a Makefile with no
> installation targets, or copying over some config files after the plugin
> does its thing.
>

I had a case where I wanted to run something before stage-packages were
pulled; I worked around the lack of hooks before stage-packages by using a
separate part; see:
https://github.com/lool/quortus-epc-snap/blob/master/snap/snapcraft.yaml#L23

I dont know how common this is, thought I'd mention it


Haha, nice hack. If it were me, I would have considered writing a new
plugin to hide that from my YAML. I'm a little OCD though, so let's be
honest: is a dirtier YAML worth not having to write a plugin? Should we
support pre/post scriptlets for the 'pull' step as well?

Kyle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20170220/ac22bc77/attachment.html>


More information about the Snapcraft mailing list