Skip to content

Feat: add syntax to imports to specify a name for injecting the path into the run script env #754

@mikemccracken

Description

@mikemccracken

Is your feature request related to a problem? Please describe.

A common pattern is to import some versioned tarball:

foo:
    from: ...
    imports:
       - path: https://host/path/to/mything-v2.2.tar.gz
         hash: nicehash

then in the run field, to avoid hardcoding the version everywhere we might say

tar zxvf /stacker/imports/mything-* -C /

but this is also a little error prone.

Describe the solution you'd like

let us give a name to use for an env var that stacker will set to the path of the new import:

foo:
    from: ...
    imports:
       - path: https://host/path/to/mything-v2.2.tar.gz
         hash: nicehash
         name: MYTHING
   run: |
       tar zxvf $MYTHING -C /

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions