feat(docker-watcher): phase 7 - deployer & health checker
Deploy orchestrator with full pipeline: pull → create container → start → network → NPM proxy → health check. Rollback on failure, multi-instance support, max_instances enforcement, webhook notifications. Fix NPM auth in rollback and error logging in removeInstance.
This commit is contained in:
@@ -24,7 +24,17 @@ func (d *Deployer) rollback(ctx context.Context, deployID string, containerID st
|
||||
|
||||
// Delete the NPM proxy host if it was created.
|
||||
if npmProxyID > 0 {
|
||||
if err := d.npm.DeleteProxyHost(ctx, npmProxyID); err != nil {
|
||||
settings, err := d.store.GetSettings()
|
||||
if err != nil {
|
||||
log.Printf("rollback: get settings for npm auth: %v", err)
|
||||
d.logDeploy(deployID, fmt.Sprintf("Rollback: failed to get settings for proxy cleanup: %v", err), "error")
|
||||
} else if npmPassword, err := d.decryptNpmPassword(settings.NpmPassword); err != nil {
|
||||
log.Printf("rollback: decrypt npm password: %v", err)
|
||||
d.logDeploy(deployID, "Rollback: failed to decrypt NPM password for proxy cleanup", "error")
|
||||
} else if err := d.npm.Authenticate(ctx, settings.NpmEmail, npmPassword); err != nil {
|
||||
log.Printf("rollback: authenticate npm: %v", err)
|
||||
d.logDeploy(deployID, "Rollback: failed to authenticate NPM for proxy cleanup", "error")
|
||||
} else if err := d.npm.DeleteProxyHost(ctx, npmProxyID); err != nil {
|
||||
log.Printf("rollback: delete proxy host %d: %v", npmProxyID, err)
|
||||
d.logDeploy(deployID, fmt.Sprintf("Rollback: failed to delete proxy host: %v", err), "error")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user