Setting release version in snapcraft build

Leo Arias leo.arias at canonical.com
Thu Sep 1 17:46:22 UTC 2016


This is a pain point for me too. Most upstreams store the version number
in only one place, because editing more than one for every tagged
release is too boring.

When we add the snapcraft.yaml, I suspect that the version field will be
forgotten often, and it will not be in sync.

However, there are a few issues with this. First, launchpad would need a
new text field to fill the version. And then what would you write in
that field? I see problems if you write a static string and if you write
a command to be appended to the snapcraft run.

Also, it's not always straight-forward to get the version from the code.
Some projects store it in multiple statements, like major=2; minor=1;
patch=3; Transforming that into "v2.1.3" results in a script that's not
so nice.

Now, I can see it working at least for the snaps I'm building using
travis and docker. I can get the sha1 when building from master, or the
name of tag when there is one, and use that as the version. I would love
that.

We could make that snapcraft --snap-version=$(git rev-parse HEAD) just
overwrites the version field, useful immediately for people not using
launchpad.

pura vida

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160901/85c87b02/attachment.sig>


More information about the Snapcraft mailing list