[PR #348] [MERGED] feat: deployers #929

Closed
opened 2026-03-03 01:06:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/certimate-go/certimate/pull/348
Author: @fudiwei
Created: 11/19/2024
Status: Merged
Merged: 11/22/2024
Merged by: @usual2970

Base: mainHead: feat/deployer


📝 Commits (10+)

  • 295b777 refactor: clean code
  • 43b2ff7 refactor: extract x509 transformer utils
  • 26d11de feat: add deployer interface
  • aa7fb7d Merge branch 'main' into feat/deployer
  • 6367785 feat: implement local, ssh, webhook Deployer
  • 51fb9dc test: add some unit test cases for new Deployer
  • 414d8d1 test: use flag arguments in test cases for Notifier and Deployer
  • 6a15186 feat: implement k8s secret Deployer
  • a6c93ef test: fix typo
  • 82807fc refactor: clean code

📊 Changes

83 files changed (+7526 additions, -260 deletions)

View changed files

📝 internal/applicant/volcengine.go (+2 -2)
📝 internal/deployer/deployer.go (+6 -66)
internal/deployer/factory.go (+374 -0)
📝 internal/deployer/huaweicloud_elb.go (+2 -10)
📝 internal/deployer/local.go (+3 -2)
📝 internal/deployer/ssh.go (+3 -2)
📝 internal/deployer/volcengine_cdn.go (+4 -4)
📝 internal/deployer/volcengine_live.go (+4 -4)
📝 internal/domain/access.go (+11 -6)
📝 internal/domain/domains.go (+2 -2)
📝 internal/notify/factory.go (+16 -16)
internal/pkg/core/deployer/deployer.go (+24 -0)
internal/pkg/core/deployer/logger.go (+117 -0)
internal/pkg/core/deployer/logger_test.go (+56 -0)
internal/pkg/core/deployer/providers/aliyun-alb/aliyun_alb.go (+289 -0)
internal/pkg/core/deployer/providers/aliyun-alb/aliyun_alb_test.go (+118 -0)
internal/pkg/core/deployer/providers/aliyun-alb/defines.go (+10 -0)
internal/pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn.go (+93 -0)
internal/pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn_test.go (+75 -0)
internal/pkg/core/deployer/providers/aliyun-clb/aliyun_clb.go (+291 -0)

...and 63 more files

📄 Description

该 PR 包含以下内容变更:

  • feat: 新增 Deployer(“部署器”)的抽象业务逻辑,并实现原有的部署目标。相关代码位于 /internal/pkg/core/deployer/ 目录下。
  • refactor: 优化代码:
    1. 提取 PEM 证书格式转换器相关方法到公共工具类下:/internal/pkg/utils/x509/transformer.go
    2. 格式化部分源代码。

【备注】

关于 Deployer

#227 中实现的 Uploader 和 #321 中实现的 Notifier 类似,旨在:

  • 统一的业务抽象层,与 certimate 本身的业务流程解耦;
  • 各部署目标独立化封装,对单元测试友好 (示例:/internal/pkg/core/deployer/providers/webhook/webhook_test.go);
  • 位于 /pkg/ 包下,便于日后作为类库对外暴露。

⚠️ 因存在 Breaking Changes,故虽已实现原有的全部部署目标,但并未实际替换原有的 /internal/deployer/ 实现。计划于下一个大版本前替换。


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/certimate-go/certimate/pull/348 **Author:** [@fudiwei](https://github.com/fudiwei) **Created:** 11/19/2024 **Status:** ✅ Merged **Merged:** 11/22/2024 **Merged by:** [@usual2970](https://github.com/usual2970) **Base:** `main` ← **Head:** `feat/deployer` --- ### 📝 Commits (10+) - [`295b777`](https://github.com/certimate-go/certimate/commit/295b7779eeac629e2f6dc491db7657309cfddf4f) refactor: clean code - [`43b2ff7`](https://github.com/certimate-go/certimate/commit/43b2ff795738ece87c0a41b5e70b1ff9644c4c77) refactor: extract x509 transformer utils - [`26d11de`](https://github.com/certimate-go/certimate/commit/26d11de249555cff51cbce4f979d8f05e779f101) feat: add deployer interface - [`aa7fb7d`](https://github.com/certimate-go/certimate/commit/aa7fb7da06d6e5fe07868a0eca2445ddd3e508de) Merge branch 'main' into feat/deployer - [`6367785`](https://github.com/certimate-go/certimate/commit/6367785b1bc203ee15f82d13e6af167a0c2ca63c) feat: implement local, ssh, webhook `Deployer` - [`51fb9dc`](https://github.com/certimate-go/certimate/commit/51fb9dca58078f78ffb01506333290fdd3e312fc) test: add some unit test cases for new `Deployer` - [`414d8d1`](https://github.com/certimate-go/certimate/commit/414d8d140e7f5ae775cd328b300ec012957ce8a5) test: use flag arguments in test cases for `Notifier` and `Deployer` - [`6a15186`](https://github.com/certimate-go/certimate/commit/6a151865f7f3652409edce952420f66d2c25da3b) feat: implement k8s secret `Deployer` - [`a6c93ef`](https://github.com/certimate-go/certimate/commit/a6c93ef9b81232b1310db153bf7c7ac6cab3b02e) test: fix typo - [`82807fc`](https://github.com/certimate-go/certimate/commit/82807fcc1bb03b98635b92bf31f2b5daa8f02933) refactor: clean code ### 📊 Changes **83 files changed** (+7526 additions, -260 deletions) <details> <summary>View changed files</summary> 📝 `internal/applicant/volcengine.go` (+2 -2) 📝 `internal/deployer/deployer.go` (+6 -66) ➕ `internal/deployer/factory.go` (+374 -0) 📝 `internal/deployer/huaweicloud_elb.go` (+2 -10) 📝 `internal/deployer/local.go` (+3 -2) 📝 `internal/deployer/ssh.go` (+3 -2) 📝 `internal/deployer/volcengine_cdn.go` (+4 -4) 📝 `internal/deployer/volcengine_live.go` (+4 -4) 📝 `internal/domain/access.go` (+11 -6) 📝 `internal/domain/domains.go` (+2 -2) 📝 `internal/notify/factory.go` (+16 -16) ➕ `internal/pkg/core/deployer/deployer.go` (+24 -0) ➕ `internal/pkg/core/deployer/logger.go` (+117 -0) ➕ `internal/pkg/core/deployer/logger_test.go` (+56 -0) ➕ `internal/pkg/core/deployer/providers/aliyun-alb/aliyun_alb.go` (+289 -0) ➕ `internal/pkg/core/deployer/providers/aliyun-alb/aliyun_alb_test.go` (+118 -0) ➕ `internal/pkg/core/deployer/providers/aliyun-alb/defines.go` (+10 -0) ➕ `internal/pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn.go` (+93 -0) ➕ `internal/pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn_test.go` (+75 -0) ➕ `internal/pkg/core/deployer/providers/aliyun-clb/aliyun_clb.go` (+291 -0) _...and 63 more files_ </details> ### 📄 Description 该 PR 包含以下内容变更: - **feat**: 新增 Deployer(“部署器”)的抽象业务逻辑,并实现原有的部署目标。相关代码位于 `/internal/pkg/core/deployer/` 目录下。 - **refactor**: 优化代码: 1. 提取 PEM 证书格式转换器相关方法到公共工具类下:`/internal/pkg/utils/x509/transformer.go`; 2. 格式化部分源代码。 --- ### 【备注】 #### 关于 Deployer 与 #227 中实现的 Uploader 和 #321 中实现的 Notifier 类似,旨在: - 统一的业务抽象层,与 certimate 本身的业务流程解耦; - 各部署目标独立化封装,对单元测试友好 (示例:`/internal/pkg/core/deployer/providers/webhook/webhook_test.go`); - 位于 `/pkg/` 包下,便于日后作为类库对外暴露。 --- ⚠️ 因存在 Breaking Changes,故虽已实现原有的全部部署目标,但并未实际替换原有的 `/internal/deployer/` 实现。计划于下一个大版本前替换。 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 01:06:52 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#929
No description provided.