-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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: Add api for online version update #1882
Conversation
Pull latest
1. 仅提供版本控制的后端api 2. 基于github api实现, 异步下载新版本的jar包 3. 构造与启动当前jar包相似的启动命令来启动新版本halo.jar 4. 备份并删除原版jar包
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@Camsyn 感谢你的贡献,但此特性我们认为在目前阶段并不适合添加。建议在提交 PR 前在原 issue 进行方案讨论,甚至提交 RFC:https://github.com/halo-dev/rfcs。 由于目前 master 分支处于 1.5.x 阶段,1.5.x 并不会添加任何新的特性,且原 issue 被设置的 milestone 为 2.0。所以此 PR 可能暂时无法合并,如果可能,至少得到 1.6.x。 /hold |
感谢开发者回复。很抱歉我没能在原issue下讨论。我知晓当前版本不适合添加新的特性,但限于课程要求,必须参与开源项目(提出pr)。此次pr只是提供一个可能的技术方案和代码原型,若是此后能够帮助本feature的落地就再好不过了。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Camsyn,首先感谢花时间完成在线更新的功能。不过我们有几点需要考虑:
- 如果用户使用的 Docker 部署的 Halo,自动更新的功能是否还需要
- 是否应该支持跨 minor 版本的升级。比如:1.4.x 升级至 1.5.x
- Halo 的部分用户在国内,所以我们特别地在 https://dl.halo.run/release/ 托管了 Halo 的 JAR 包,那么是否需要支持动态设置下载方式。
- 如果手动运行 Halo 的时候设置了一些环境变量,那么以同样方式重启 Halo 的时候还能获取到环境变量么。
/kind feature |
/milestone 1.6.x |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议引入 GitHub Java SDK 来访问 GitHub 相关的 API,降低维护成本。例如:https://github.com/spotify/github-java-client 或者 https://github.com/hub4j/github-api 。
第一个github-client过于简单,无法获取release,且必须认证来获取所有权限。第二个github-api实测可以使用,但是其 |
目前我们的 Docker 镜像里面应该不是包含的 Jar,有做构建分层,所以这样的更新方式可能并不适合在 Docker 环境。参考 https://github.com/halo-dev/halo/blob/master/Dockerfile 补充几个观点:
|
@Camsyn: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
由于 1.x 的版本已经进入维护阶段,不会添加新功能,并且此 PR 也已经不适用于 2.x,所以我将关闭此 PR。 再次感谢你的贡献。 /close |
@ruibaby: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this PR does?
Why we need it?
方便在线的halo版本检测与切换
Mechanism
Problem
本地测试
如下面视频所示
https://user-images.githubusercontent.com/65994555/164885248-b41f7a73-0659-4747-81fe-1c99a0abd778.mp4