mirror of
https://github.com/usual2970/certimate.git
synced 2025-10-05 22:14:53 +00:00
support ssh deployemnt
This commit is contained in:
@@ -21,7 +21,11 @@ const (
|
||||
)
|
||||
|
||||
func deploy(ctx context.Context, record *models.Record) error {
|
||||
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
app.GetApp().Logger().Error("部署失败", "err", r)
|
||||
}
|
||||
}()
|
||||
currRecord, err := app.GetApp().Dao().FindRecordById("domains", record.Id)
|
||||
history := NewHistory(record)
|
||||
defer history.commit()
|
||||
@@ -86,7 +90,7 @@ func deploy(ctx context.Context, record *models.Record) error {
|
||||
history.record(applyPhase, "保存证书成功", nil, true)
|
||||
|
||||
// ############3.部署证书
|
||||
history.record(deployPhase, "开始部署", nil)
|
||||
history.record(deployPhase, "开始部署", nil, false)
|
||||
deployer, err := deployer.Get(currRecord)
|
||||
if err != nil {
|
||||
history.record(deployPhase, "获取deployer失败", err)
|
||||
|
@@ -34,8 +34,8 @@ func NewHistory(record *models.Record) *history {
|
||||
|
||||
func (a *history) record(phase Phase, msg string, err error, pass ...bool) {
|
||||
a.Phase = phase
|
||||
if len(pass) > 0 && pass[0] {
|
||||
a.PhaseSuccess = true
|
||||
if len(pass) > 0 {
|
||||
a.PhaseSuccess = pass[0]
|
||||
}
|
||||
|
||||
errMsg := ""
|
||||
|
Reference in New Issue
Block a user