pro tip: use scriptlets instead of custom plugins

Loïc Minier loic.minier at ubuntu.com
Mon Feb 20 17:45:14 UTC 2017


I can't really say how common this is; it's the first time I had to hack
around stage-packages; it could indeed have been addressed through a plugin

I was just thinking that if you add pre- post- hooks for every step of the
lifecycle, then one before pull would have worked for me here; I have a
solution in place, so this was just FYI

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

> 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
>
> --
> Snapcraft mailing list
> Snapcraft at lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
>


-- 
- Loïc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20170220/a9a88061/attachment.html>


More information about the Snapcraft mailing list