Dynamically install plugin version on runtime (deploy)
- Dominant language
- Python
- Stars
- 37
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
> Requires (depends on) [Set the plugin version on custom image build #315](https://github.com/bitovi/bitops/issues/315) for version in the plugin `install.sh` implementation first.
Provide users a way to install the needed plugin version on runtime(deploy) directly from the Omnibus image.
In the ops repo's `bitops.config.yaml` for a given tool, support the `${tool}.options.version` flag). That way, if users want to specify a version of a tool, it'll work (though it'll take longer). Then, when they are comfortable with things, they can create their own bitops image with pinned versions (which is more involved #315).
Example `bitops.config.yaml` for installing terraform version on runtime:
```
terraform:
cli:
var-file: my-vars.tfvars
target: terraform.module.resource
options:
version: 1.2.3 # <--- new setting
stack-action: "plan"
workspace: test
```
and so `1.2.3` will be passed to the plugin `install.sh` to install the needed tool version:
https://github.com/bitops-plugins/terraform/blob/b189c2dd7cb38e7e883837f0f3204e5b7e8a6e6b/install.sh#L13-L14
This was originally suggested here (for the TF plugin): https://github.com/bitovi/bitops/issues/307#issuecomment-1261306156.
When installing the tool on runtime, explicitly warn users about risks of using it:
>`
>WARNING: You've set the custom Terraform version 1.2.3 in the bitops.config.yaml. This will download and install the tool before every deploy, which is not recommended for production. Try it at your own risk! We encourage you to pre-package your own BitOps image instead. See how to do that: https://bitovi.github.io/bitops/plugins/#creating-your-own-bitops-image
>`
See more details in the discussions below.
### Previous Discussions
- #307
- https://github.com/bitovi/bitops/discussions/206
Contributor guide
Research direction
Start by tracing how runtime deploys read bitops.config.yaml and pass tool options to the plugin install.sh interface; the issue specifically points to the Terraform install.sh version argument. Compare the example version setting with the requested warning, then identify or add coverage for runtime installation and the production-risk message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100