<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Le 09/11/2016 à 07:44, Enwei Zhang a
écrit :<br>
</div>
<blockquote
cite="mid:CADY8Wod_D8Q55Yrre1eHq8QsMdiDZwfsWbFJxQe0UKR17qSjwA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi Didier,<br>
</div>
Sorry to cut in.<br>
</div>
Is "hooks" working now in snapcraft?<br>
</div>
I encountered error:<br>
I used below in snapcraft.yaml:<br>
<br>
hooks: # Top-level YAML attribute, parallel to `apps`<br>
upgrade: # Hook name, corresponds to executable name<br>
plugs: [network] # Or any other plugs required by
this hook<br>
<br>
enwei@XPS-13-9350:~/work/snap/simple-daemon$ snapcraft<br>
Issues while validating snapcraft.yaml: Additional
properties are not allowed ('hooks' was unexpected)<br>
enwei@XPS-13-9350:~/work/snap/simple-daemon$ snapcraft
--version<br>
2.20<br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
No, right now, they are only implemented in snapd.<br>
You need to place the correct file in the meta/hooks/ folder (if you
are using snapcraft, do this in the prime/ directory, before
"snapcraft snap prime/").<br>
<br>
There is an example available at
<a class="moz-txt-link-freetext" href="https://github.com/snapcore/snapd/tree/master/tests/lib/snaps/basic-hooks/meta/hooks">https://github.com/snapcore/snapd/tree/master/tests/lib/snaps/basic-hooks/meta/hooks</a>.<br>
<br>
Hope that helps!<br>
Didier<br>
<blockquote
cite="mid:CADY8Wod_D8Q55Yrre1eHq8QsMdiDZwfsWbFJxQe0UKR17qSjwA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div><br>
</div>
Thanks.<br>
<br>
</div>
Br<br>
</div>
Enwei<br>
<div>
<div>
<div>
<div><br>
<div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Nov 8, 2016 at 6:28 PM, Didier
Roche <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:didrocks@ubuntu.com" target="_blank">didrocks@ubuntu.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><span
class="">Le 08/11/2016 à 04:52, Kyle Fazzari a écrit :<br>
><br>
> On Nov 6, 2016 21:51, "Didier Roche" <<a
moz-do-not-send="true" href="mailto:didrocks@ubuntu.com">didrocks@ubuntu.com</a><br>
</span><span class="">> <mailto:<a
moz-do-not-send="true" href="mailto:didrocks@ubuntu.com">didrocks@ubuntu.com</a>>>
wrote:<br>
>><br>
>> Le 06/11/2016 à 00:22, Boris Rybalkin a écrit :<br>
>> ><br>
>> > Hello,<br>
>> ><br>
>><br>
>> Hey Boris,<br>
>> ><br>
>> > I want to generate my config on snap install
using snap location<br>
>> > variables.<br>
>> ><br>
>> > From the docs configure hook is only
triggered when 'snap set' is<br>
>> > called. Will configure also be called on
install and upgrade?<br>
>> ><br>
>> I didn't try it myself yet, but from what I heard
yeah, they will be run<br>
>> at that time. Kyle can confirm (and if so, we'll
update to the<br>
>> documentation to reflect that).<br>
><br>
> When I wrote it (and the docs) it was only run with
`snap set`. I<br>
> believe it's been modified since then to run upon
initial install as<br>
> well as upgrade; indeed Gustavo mentioned that it
should serve as an<br>
> install and an upgrade hook. The docs weren't updated
with this change,<br>
> it seems. That recommendation should also be
documented.<br>
><br>
> Kyle<br>
><br>
<br>
</span>FYI, opened <a moz-do-not-send="true"
href="https://github.com/ubuntudesign/snapcraft.io/issues/216"
rel="noreferrer" target="_blank">https://github.com/<wbr>ubuntudesign/snapcraft.io/<wbr>issues/216</a><br>
about it (after confirming manually this new behavior).<br>
<br>
So, to answer on the initial reply: yes, the hooks are ran
on install<br>
and upgrade.<br>
<div class="HOEnZb">
<div class="h5"><br>
Cheers,<br>
Didier<br>
<br>
--<br>
Snapcraft mailing list<br>
<a moz-do-not-send="true"
href="mailto:Snapcraft@lists.snapcraft.io">Snapcraft@lists.snapcraft.io</a><br>
Modify settings or unsubscribe at: <a
moz-do-not-send="true"
href="https://lists.ubuntu.com/mailman/listinfo/snapcraft"
rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/snapcraft</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<p><br>
</p>
</body>
</html>