El 01/09/16 a las 14:05, Casey Marshall escribió:
When automating the build process for snaps, I'd like to be able to provide the release version as an argument to snapcraft, which could then be used as a variable in the snapcraft.yaml.

For example, say I'd like to release "foo" version "1.2.3". I'd then like to build the snap with version: 1.2.3, and use the git tag "v1.2.3" in its source. For example:

name: foo
version: ${release-version}
...
parts:
  foo:
    source: git@...
    source-tag: v${release-version}

In 2.16 we are introducing a variable to set this one, it comes from the `version` defined above.


The alternatives at the moment seem to be:

1. Parse the version out of snapcraft.yaml, using that as the authoritative release version string. Workable for new projects, but a tough sell for existing projects with an established release process.

2. Generate the snapcraft.yaml from a template (jinja, for example), which works but is kind of awkward.

So, how about a ${release-version} variable in snapcraft.yaml, which you could set on the snapcraft command-line with a --release-version flag? This would be darn useful for Jenkins CI scripts that build snaps.

What would the version be set to during CI? The version from a snappy point of view is just a friendly name, the architecture only cares about revisions.
-- 
Snapcraft mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft

Reply via email to