TheRacetrack / racetrack

An opinionated framework for deploying, managing, and serving application workloads
https://theracetrack.github.io/racetrack/
Apache License 2.0
28 stars 5 forks source link

Add --out-filename parameter to racetrack plugin bundler #391

Closed iszulcdeepsense closed 6 months ago

iszulcdeepsense commented 6 months ago

When automating plugins development, very often we do something like this:

bundle:
    cd python3-job-type &&\
    racetrack plugin bundle --out=..

install:
    racetrack plugin install *.zip

make bundle install produces a latest version of ZIP plugin (eg. python3-job-type-2.11.1.zip) and uploads it to a local Racetrack instance.

However, if I change the version of a plugin and run that command again it will produce the other ZIP file (with different name) and racetrack plugin install *.zip will fail cause *.zip will be resolved by shell into 2 filenames.

Proposed Solution

Let's add --out-filename parameter to racetrack CLI plugin bundler, which will solve this issue by doing:

bundle:
    cd python3-job-type &&\
    racetrack plugin bundle --out=.. &&\
    racetrack plugin bundle --out=.. --out-filename=latest.zip

install:
    racetrack plugin install latest.zip

Apart from generating versioned filename python3-job-type-2.11.1.zip, it will also spit out latest.zip alias, ready to be installed by script.