Merge lp:~michael.nelson/snapcraft/fix-golang-tutorial-to-match-changes-from-r132 into lp:~snappy-dev/snapcraft/core

Proposed by Michael Nelson
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 153
Merged at revision: 151
Proposed branch: lp:~michael.nelson/snapcraft/fix-golang-tutorial-to-match-changes-from-r132
Merge into: lp:~snappy-dev/snapcraft/core
Diff against target: 95 lines (+18/-23)
1 file modified
docs/your-first-snap.md (+18/-23)
To merge this branch: bzr merge lp:~michael.nelson/snapcraft/fix-golang-tutorial-to-match-changes-from-r132
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
Review via email: mp+270131@code.launchpad.net

Commit message

Fix snapcraft.yaml's reference to go-package plugin to match changes in r132.

Description of the change

Without this, following the tutorial results in:

$ snapcraft stage
Unknown plugin: go1.4-project
Could not load part go1.4-project

Currently, if you try to add a:

    snappy-metadata: meta

to your snapcraft.yaml, you'll see an error [1]. Turns out the metadata is now expected in the snapcraft.yaml itself, so README updated to match that after testing locally.

[1] http://paste.ubuntu.com/12270254/

To post a comment you must log in.
152. By Michael Nelson

Update your-first-snap now that metadata is in the snapcraft.yaml file itself.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

it all looks good, thanks, just maybe pick a different a icon?

153. By Michael Nelson

Switch example icon to text-x-apport.png

Revision history for this message
Michael Nelson (michael.nelson) wrote :

On Mon, Sep 7, 2015 at 11:21 PM Sergio Schvezov <
<email address hidden>> wrote:

> it all looks good, thanks, just maybe pick a different a icon?
>
> Diff comments:
>
> > === modified file 'docs/your-first-snap.md'
> > --- docs/your-first-snap.md 2015-08-05 13:38:39 +0000
> > +++ docs/your-first-snap.md 2015-09-04 03:24:38 +0000
> > @@ -213,9 +205,12 @@
> > plugin: copy
> > files:
> > webcam-webui: bin/webcam-webui
> > - snappy-metadata: meta
> > -
> > -And tell Snapcraft to actually make the snap package:
> > +
> > +Copy a png icon of your choice into your current directory:
> > +
> > + $ cp /usr/share/icons/hicolor/256x256/apps/unity-datetime-panel.png
> ./icon.png
>
> how about a different icon?
>
>
Done. It's just an example to run the demo (as the icon is now required),
but I've switch it
to /usr/share/icons/hicolor/64/mimetypes/text-x-apport.png

Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Ok, thanks! I'll improve snapcraft init to get a 'template' of the required fields soon, it's one of the reasons I disabled daily builds as of yet.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/your-first-snap.md'
2--- docs/your-first-snap.md 2015-08-05 13:38:39 +0000
3+++ docs/your-first-snap.md 2015-09-07 13:30:28 +0000
4@@ -70,14 +70,13 @@
5
6 parts:
7 golang-static-http:
8- plugin: go1.4-project
9+ plugin: go-project
10 source: git://github.com/mikix/golang-static-http
11
12 You've got a `parts` list with one item, named `golang-static-http`, but we
13 could call it anything. That part has a few options. A `plugin` option that
14-tells Snapcraft how to interpret the part. In this case, it's a Go project
15-using Go 1.4. And finally, a `source` option telling Snapcraft where to
16-download the code.
17+tells Snapcraft how to interpret the part. In this case, it's a Go project.
18+And finally, a `source` option telling Snapcraft where to download the code.
19
20 Go ahead and create `snapcraft.yaml` with the above contents in an empty
21 directory.
22@@ -104,7 +103,7 @@
23
24 parts:
25 golang-static-http:
26- plugin: go1.4-project
27+ plugin: go-project
28 source: git://github.com/mikix/golang-static-http
29 fswebcam:
30 plugin: ubuntu
31@@ -153,7 +152,7 @@
32
33 parts:
34 golang-static-http:
35- plugin: go1.4-project
36+ plugin: go-project
37 source: git://github.com/mikix/golang-static-http
38 fswebcam:
39 plugin: ubuntu
40@@ -179,14 +178,13 @@
41 ### Package Metadata
42
43 "But how do we actually make a snap?", you may be wondering. To do that, we
44-need some metadata files required by Snappy that describe how our code should
45-be installed and run.
46+need to add some Snappy metadata that describes how our code should be
47+installed and run.
48
49 You can read all about the [format of this metadata](https://developer.ubuntu.com/en/snappy/guides/packaging-format-apps/),
50 but we'll assume here that you're already familiar.
51
52-Let's make a new subdirectory called `meta` and put our Snappy package files
53-there. Here's the contents of `meta/package.yaml`:
54+Let's add some metadata to our snapcraft file
55
56 name: webcam-webui
57 version: 1
58@@ -194,18 +192,12 @@
59 services:
60 - name: webcam-webui
61 start: bin/webcam-webui
62-
63-And a very simple `meta/readme.md`:
64-
65- # Webcam web UI
66-
67- Exposes your webcam over a web UI
68-
69-Now that we have that sorted, we can tell Snapcraft where to find our metadata:
70-
71+ summary: Webcam web UI
72+ description: Exposes your webcam over a web UI
73+ icon: icon.png
74 parts:
75 golang-static-http:
76- plugin: go1.4-project
77+ plugin: go-project
78 source: git://github.com/mikix/golang-static-http
79 fswebcam:
80 plugin: ubuntu
81@@ -213,9 +205,12 @@
82 plugin: copy
83 files:
84 webcam-webui: bin/webcam-webui
85- snappy-metadata: meta
86-
87-And tell Snapcraft to actually make the snap package:
88+
89+Copy a png icon of your choice into your current directory:
90+
91+ $ cp /usr/share/icons/hicolor/64/mimetypes/text-x-apport.png ./icon.png
92+
93+and tell Snapcraft to actually make the snap package:
94
95 $ snapcraft assemble
96

Subscribers

People subscribed via source and target branches