|
|
|
@ -41,6 +41,12 @@ func (s *ReleaseServer) RollbackRelease(c ctx.Context, req *services.RollbackRel
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !req.DryRun {
|
|
|
|
|
s.Log("creating rolled back release for %s", req.Name)
|
|
|
|
|
if err := s.env.Releases.Create(targetRelease); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
s.Log("performing rollback of %s", req.Name)
|
|
|
|
|
res, err := s.performRollback(currentRelease, targetRelease, req)
|
|
|
|
|
if err != nil {
|
|
|
|
@ -48,8 +54,8 @@ func (s *ReleaseServer) RollbackRelease(c ctx.Context, req *services.RollbackRel
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !req.DryRun {
|
|
|
|
|
s.Log("creating rolled back release %s", req.Name)
|
|
|
|
|
if err := s.env.Releases.Create(targetRelease); err != nil {
|
|
|
|
|
s.Log("updating status for rolled back release for %s", req.Name)
|
|
|
|
|
if err := s.env.Releases.Update(targetRelease); err != nil {
|
|
|
|
|
return res, err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -96,7 +102,7 @@ func (s *ReleaseServer) prepareRollback(req *services.RollbackReleaseRequest) (*
|
|
|
|
|
FirstDeployed: crls.Info.FirstDeployed,
|
|
|
|
|
LastDeployed: timeconv.Now(),
|
|
|
|
|
Status: &release.Status{
|
|
|
|
|
Code: release.Status_UNKNOWN,
|
|
|
|
|
Code: release.Status_PENDING,
|
|
|
|
|
Notes: prls.Info.Status.Notes,
|
|
|
|
|
},
|
|
|
|
|
// Because we lose the reference to rbv elsewhere, we set the
|
|
|
|
|