-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Support for downloading releases based on some version constraint #30
Comments
Thanks for raising this @ProbstDJakob. A direct download URL would require a web worker, which would be good to avoid. However, we could use the releases generator present in this repository to pre-generate a simple text and/or JSON file for each major and minor version that would contain the artifacts. This would make it feasible to pass simple version constraints to the POSIX/PowerShell scripts. I raised this issue for the core team for discussion. |
I am not quite sure if I am understanding you correctly. To rephrase you in my own words, you do not host a web server like nginx or caddy to serve the content and thus can not write custom redirect rules. Instead you use a static file hosting service. If this is the case, a directory structure like the following could be generated on rollouts based on the current releases:
This way no need for something like |
We use CloudFlare to host static files. While we can technically use workers to create dynamic content, their use costs money and it would be good to avoid that. Other than that, yes, this would roughly be the approach. |
Hey @ProbstDJakob we discussed this with the core team and we decided that this would be worth implementing in some form (probably by providing simple to parse download information in a file). |
That sounds great, thanks. |
I've tried to use the docker image
ghcr.io/opentofu/opentofu:1
in order to have the latest version of OpenTofu with all bug fixes but without any breaking changes. This approach had some disadvantages which led me to open the issue opentofu/opentofu#1931 and the result of it was that the image should not be used for my (specific) purpose. Throughout searching for a solution, we came up with the idea to add version resolving toget.opentofu.org
(opentofu/opentofu#1931 (comment)).The idea is that there would be an URL which accepts partial versions and expands them to the latest matching release. For example when requesting
https://get.opentofu.org/download/plattform/linux/amd64/1.tar.gz
it would redirect tohttps://get.opentofu.org/download/plattform/linux/amd64/1.8.2.tar.gz
which in turn would redirect tohttps://github.com/opentofu/opentofu/releases/download/v1.8.2/tofu_1.8.2_linux_amd64.tar.gz
. Or to put it in a more technical example (pseudo configuration):Yes not all combinations of the RegEx are valid assets, but this is just an example and also GitHub would just return 404.
This could also be achieved by dynamically evaluation to which version the URL
https://get.opentofu.org/download/plattform/linux/amd64/1.tar.gz
should resolve to, but then the web server would then need to either query the GitHub API or keep an updated Git Repo clone to query that one. In either case the web server is more likely to struggle with handling a huge amount of requests. On the other hand the approach via a hardcoded configuration would need to be updated on every release. If there is an automatic release pipeline, this would be not much of a problem, but doing this manually is cumbersome.The text was updated successfully, but these errors were encountered: