Hi, I noticed that the Travis snap package is out of date, likely because they need to bump the version manually.
They already bump the version manually on their Gemfile (it’s a Ruby app). I would like to write a patch so that snapcraft can read the version number from such Gemfile instead of having a fixed value.
I managed to make it work, however, the version remains nil. Do you know why? I’m thinking it’s because I’m setting it in the build stage, but I’m not sure. Also, I cannot set it in the pull stage as ruby is not yet installed at that time. Some help?
Edit
I needed to remove version and set adopt-info: travis, where travis is the name of the part that sets such info
Too bad, it would make thigs much more easier, but I imagine it would also make the parsing much more complicated
A possible idea, to eventually consider if such variable replacing mechanism was also useful in other scenarios, is to use a template mechanism. So you parse the template first, which replaces the variables, and you produce the yaml, to be parsed from snapcraft. Actually, I think it could work even today, without modifications, using something like Jinja to parse the template and then using running snapcraft on the produced yaml Just thinking aloud
It’s also important to use the adopt-info high level key (see using external metadata docs), mentioning the part that you are fetching the version, or just create a part called version like it’s done in the previous example.