feat: Install Plugins alongside Flux setup in gh actions#5955
Conversation
9188345 to
970d438
Compare
6231f3e to
0a7366c
Compare
|
I did run some tests here -> https://github.com/gat786/flux2/actions/runs/28187933002 if it helps with anything! |
matheuscscp
left a comment
There was a problem hiding this comment.
Hey @gat786, thanks very much for this PR!
We need to add an if: field to the plugin step so it runs only if inputs.plugins is specified.
Also, let's rename plugin_dir to plugin-dir, which is the GHA convention. We should also define a sensible default for this input, as people will probably not have an opinion about it. Finally, the effective plugin-dir should be an output of this action, because even though people will not want to think about it to choose one, they will still need the default directory chosen by the action e.g. for the mirror plugin, which for some commands expects the config file to be a sibling of the binary in the filesystem.
|
Hey @gat786 please squash, rebase and force-push, this PR should have a single commit 🙏 |
f0975c5 to
b98e3ca
Compare
|
@matheuscscp after a few back and forths me donez! |
|
Looks like the |
|
oh no, lemme check |
fe7de52 to
abbe40c
Compare
|
it is interesting that they do not allow using |
abbe40c to
599a047
Compare
|
Hey @gat786 this feature needs a very important gate: only the Flux CLI v2.9+ will support it. I think we need to detect the version and check if 2.9+ is satisfied, in order to print a nice error message about this requirement not being met, and that also shows the installed version. |
|
Also wondering why are the other env vars needed i.e. those beyond |
|
Hey the FLUXCD_PLUGINS is constructed using those other variables and when the other variables are not exported the construction does not happen properly, i.e. the os, arch and version entries remain empty. I can remove the other exports by constructing fluxcd plugins directory in the same step as installation but since installation of plugins is going to be condition based I had to do it in its own step and for that exports need to happen. |
|
I think we can use step inputs/outputs for this, and not export envs. This way it stays internal. |
570119b to
ce54224
Compare
|
Hey I added a feature gate and did some testing on it as well across platforms it does seem to work according to me, please check whenever you can! |
ce54224 to
1fc84e5
Compare
Signed-off-by: Ganesh Tiwari <ganesht049@gmail.com>
1fc84e5 to
542dbb5
Compare
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
matheuscscp
left a comment
There was a problem hiding this comment.
LGTM! 🚀
@gat786 Thanks very much for the contribution!
|
Thank you so much! |
|
I would like to participate even more in the upcoming future! Learnt a lot from this implementation! |
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
This PR adds the capability of installing plugins to the action which sets up Flux on a GH Action.
Closes: #5933
Adds two new variables to the GH Action input
<name>@<version|digest>.Example:
mirror@0.0.1FLUXCD_PLUGINSenv variable.And outputs
plugin-dir- Directory where the plugin binaries are present. This helps in users know the directory even when it was unspecified and they can use this value for further processing if need be.the plugin support comes with a feature gate which is designed to exit with an error when plugins were specified but the flux binary installed does not support plugins yet (i.e. it has a version
< 2.9.0.