Open gustaff-weldon opened 1 year ago
@gustaff-weldon thanks for creating this issue! This is actually not a bad idea, we'll discuss this internally and then let you know!
Hi @FabianKramm thanks. I already have another use case for this. I would like to write a util that would download identifiers of latest images in our ECR and pass those as variables to deployments. This would allow me to avoid updating devspace files with every image release, instead just getting them dynamically when user tries to deploy.
Obviously such an util would be better of running from a proper programming language script (node, ruby, go) rather then from a shell.
Is your feature request related to a problem?
Yes, it is related to creating a function that does quite complicated operations on dependency arrays better done in languages other than shell. Currently, it is not possible to create a plugin that would bring in the function that under the hood just calls the binary with a specific parameters (similar to how commands work).
Which solution do you suggest?
Add ability to add custom functions that would be run against a given binary installed with the plugin eg. into
$HOME/devspace/functions
.Things to consider:
Which alternative solutions exist? One can create a shared function that calls a binary:
and then use it with
imports
in many projects.Problem, with this approach is, that binary path would change depending on the nesting of the project.
An alternative approach, would be to create a wrapper plugin, which will bring in the binary that would be installed during some of the
pre-*
hooks execution into a known location eg.$HOME/devspace/functions
and that could be referenced from there:Additional context This started as a thread on Slack https://loft-sh.slack.com/archives/CDSV29U85/p1666360242137239