mirror of
https://github.com/usual2970/certimate.git
synced 2025-10-05 14:04:54 +00:00
feat: support configuring repeatable deploy in deployment
This commit is contained in:
@@ -76,7 +76,7 @@ type WorkflowNodeConfigForDeploy struct {
|
||||
Provider string `json:"provider"` // 主机提供商
|
||||
ProviderAccessId string `json:"providerAccessId"` // 主机提供商授权记录 ID
|
||||
ProviderConfig map[string]any `json:"providerConfig"` // 主机提供商额外配置
|
||||
SkipOnLastSucceeded bool `json:"skipOnLastSucceeded"` // TODO: 上次部署成功时是否跳过
|
||||
SkipOnLastSucceeded bool `json:"skipOnLastSucceeded"` // 上次部署成功时是否跳过
|
||||
}
|
||||
|
||||
type WorkflowNodeConfigForNotify struct {
|
||||
|
@@ -136,5 +136,5 @@ func (a *applyNode) checkCanSkip(ctx context.Context, lastOutput *domain.Workflo
|
||||
}
|
||||
}
|
||||
|
||||
return false, "无历史申请记录"
|
||||
return false, ""
|
||||
}
|
||||
|
@@ -99,7 +99,6 @@ func (d *deployNode) Run(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (d *deployNode) checkCanSkip(ctx context.Context, lastOutput *domain.WorkflowOutput) (skip bool, reason string) {
|
||||
// TODO: 可控制是否强制部署
|
||||
if lastOutput != nil && lastOutput.Succeeded {
|
||||
// 比较和上次部署时的关键配置(即影响证书部署的)参数是否一致
|
||||
currentNodeConfig := d.node.GetConfigForDeploy()
|
||||
@@ -111,8 +110,10 @@ func (d *deployNode) checkCanSkip(ctx context.Context, lastOutput *domain.Workfl
|
||||
return false, "配置项变化:主机提供商参数"
|
||||
}
|
||||
|
||||
return true, "已部署过证书"
|
||||
if currentNodeConfig.SkipOnLastSucceeded {
|
||||
return true, "已部署过证书"
|
||||
}
|
||||
}
|
||||
|
||||
return false, "无历史部署记录"
|
||||
return false, ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user