Enable snap version to be used in other parts of the snapcraft.yaml

Bug #1588336 reported by Dan Watkins
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Wishlist
Sergio Schvezov

Bug Description

When building a Google Cloud SDK snap, we fetch an upstream tarball using the copy plugin. The URL that we fetch from contains the version number. To make updating to new versions quicker (and less error-prone), it would be nice if we could use the version as a variable in the URL.

--- CURRENT ---
version: 112.0.0
...
parts:
    google-cloud-sdk:
        plugin: copy
        source: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-112.0.0-linux-x86_64.tar.gz

--- IDEAL ---
version: 112.0.0
...
parts:
    google-cloud-sdk:
        plugin: copy
        source: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-{version}-linux-x86_64.tar.gz

(Or $version or ... etc.)

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Perhaps this can be more generally phrased as variable support, as I imagine having something beyond just the version be rather useful. For example, what if you want to use `112.0.0ubuntu1` (or similar) as your version instead of just the straight upstream version? In that case having `112.0.0` in another variable that can be used by both the version and source keys would be useful.

Revision history for this message
Dan Watkins (oddbloke) wrote :

+1 on this being part of a broader feature.

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

Given we are going to support an `environment` keyword for apps I was thinking that adding `build-environment` keyword for parts would be good.

Changed in snapcraft:
milestone: none → 2.11
status: New → Triaged
importance: Undecided → Wishlist
assignee: nobody → Sergio Schvezov (sergiusens)
Changed in snapcraft:
milestone: 2.12 → 2.13
Changed in snapcraft:
milestone: 2.13 → 2.14
Changed in snapcraft:
milestone: 2.13 → none
milestone: none → 2.14
Changed in snapcraft:
milestone: 2.14 → 2.15
Changed in snapcraft:
milestone: 2.15 → 2.16
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: Triaged → In Progress
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.