refactor: replace Append* to Log* in DeployerLogger
This commit is contained in:
@@ -77,7 +77,7 @@ func (d *LocalDeployer) Deploy(ctx context.Context, certPem string, privkeyPem s
|
||||
return nil, xerrors.Wrapf(err, "failed to run pre-command, stdout: %s, stderr: %s", stdout, stderr)
|
||||
}
|
||||
|
||||
d.logger.Appendt("pre-command executed", stdout)
|
||||
d.logger.Logt("pre-command executed", stdout)
|
||||
}
|
||||
|
||||
// 写入证书和私钥文件
|
||||
@@ -87,13 +87,13 @@ func (d *LocalDeployer) Deploy(ctx context.Context, certPem string, privkeyPem s
|
||||
return nil, xerrors.Wrap(err, "failed to save certificate file")
|
||||
}
|
||||
|
||||
d.logger.Appendt("certificate file saved")
|
||||
d.logger.Logt("certificate file saved")
|
||||
|
||||
if err := fs.WriteFileString(d.config.OutputKeyPath, privkeyPem); err != nil {
|
||||
return nil, xerrors.Wrap(err, "failed to save private key file")
|
||||
}
|
||||
|
||||
d.logger.Appendt("private key file saved")
|
||||
d.logger.Logt("private key file saved")
|
||||
|
||||
case OUTPUT_FORMAT_PFX:
|
||||
pfxData, err := x509.TransformCertificateFromPEMToPFX(certPem, privkeyPem, d.config.PfxPassword)
|
||||
@@ -101,13 +101,13 @@ func (d *LocalDeployer) Deploy(ctx context.Context, certPem string, privkeyPem s
|
||||
return nil, xerrors.Wrap(err, "failed to transform certificate to PFX")
|
||||
}
|
||||
|
||||
d.logger.Appendt("certificate transformed to PFX")
|
||||
d.logger.Logt("certificate transformed to PFX")
|
||||
|
||||
if err := fs.WriteFile(d.config.OutputCertPath, pfxData); err != nil {
|
||||
return nil, xerrors.Wrap(err, "failed to save certificate file")
|
||||
}
|
||||
|
||||
d.logger.Appendt("certificate file saved")
|
||||
d.logger.Logt("certificate file saved")
|
||||
|
||||
case OUTPUT_FORMAT_JKS:
|
||||
jksData, err := x509.TransformCertificateFromPEMToJKS(certPem, privkeyPem, d.config.JksAlias, d.config.JksKeypass, d.config.JksStorepass)
|
||||
@@ -115,13 +115,13 @@ func (d *LocalDeployer) Deploy(ctx context.Context, certPem string, privkeyPem s
|
||||
return nil, xerrors.Wrap(err, "failed to transform certificate to JKS")
|
||||
}
|
||||
|
||||
d.logger.Appendt("certificate transformed to JKS")
|
||||
d.logger.Logt("certificate transformed to JKS")
|
||||
|
||||
if err := fs.WriteFile(d.config.OutputCertPath, jksData); err != nil {
|
||||
return nil, xerrors.Wrap(err, "failed to save certificate file")
|
||||
}
|
||||
|
||||
d.logger.Appendt("certificate file uploaded")
|
||||
d.logger.Logt("certificate file uploaded")
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported output format: %s", d.config.OutputFormat)
|
||||
@@ -134,7 +134,7 @@ func (d *LocalDeployer) Deploy(ctx context.Context, certPem string, privkeyPem s
|
||||
return nil, xerrors.Wrapf(err, "failed to run command, stdout: %s, stderr: %s", stdout, stderr)
|
||||
}
|
||||
|
||||
d.logger.Appendt("post-command executed", stdout)
|
||||
d.logger.Logt("post-command executed", stdout)
|
||||
}
|
||||
|
||||
return &deployer.DeployResult{}, nil
|
||||
|
||||
Reference in New Issue
Block a user