feat: reveal saved server deployment inputs
This commit is contained in:
@@ -22,20 +22,38 @@ type ServerDeploymentRequest struct {
|
||||
}
|
||||
|
||||
type ServerDeploymentResponse struct {
|
||||
ServerInstanceID string `json:"serverInstanceId"`
|
||||
Mode domain.ServerDeploymentMode `json:"mode,omitempty"`
|
||||
ProfileKey string `json:"profileKey,omitempty"`
|
||||
CreateInputs map[string]string `json:"createInputs,omitempty"`
|
||||
ServerRootConfigured bool `json:"serverRootConfigured"`
|
||||
WorkingDirectoryConfigured bool `json:"workingDirectoryConfigured"`
|
||||
InstallCommandConfigured bool `json:"installCommandConfigured"`
|
||||
StartCommandConfigured bool `json:"startCommandConfigured"`
|
||||
StopCommandConfigured bool `json:"stopCommandConfigured"`
|
||||
StatusCommandConfigured bool `json:"statusCommandConfigured"`
|
||||
Shell domain.ServerCommandShell `json:"shell,omitempty"`
|
||||
Revision int `json:"revision"`
|
||||
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
|
||||
Projection ServerDeploymentProjectionBody `json:"projection,omitempty"`
|
||||
ServerInstanceID string `json:"serverInstanceId"`
|
||||
Mode domain.ServerDeploymentMode `json:"mode,omitempty"`
|
||||
ProfileKey string `json:"profileKey,omitempty"`
|
||||
CreateInputs map[string]string `json:"createInputs,omitempty"`
|
||||
ServerRootConfigured bool `json:"serverRootConfigured"`
|
||||
WorkingDirectoryConfigured bool `json:"workingDirectoryConfigured"`
|
||||
InstallCommandConfigured bool `json:"installCommandConfigured"`
|
||||
StartCommandConfigured bool `json:"startCommandConfigured"`
|
||||
StopCommandConfigured bool `json:"stopCommandConfigured"`
|
||||
StatusCommandConfigured bool `json:"statusCommandConfigured"`
|
||||
Shell domain.ServerCommandShell `json:"shell,omitempty"`
|
||||
Revision int `json:"revision"`
|
||||
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
|
||||
Projection ServerDeploymentProjectionBody `json:"projection,omitempty"`
|
||||
LatestDispatch *ServerDeploymentDispatchEvidenceBody `json:"latestDispatch,omitempty"`
|
||||
}
|
||||
|
||||
type ServerDeploymentRevealResponse struct {
|
||||
ServerInstanceID string `json:"serverInstanceId"`
|
||||
ServerRoot string `json:"serverRoot"`
|
||||
WorkingDirectory string `json:"workingDirectory"`
|
||||
InstallCommand string `json:"installCommand"`
|
||||
StartCommand string `json:"startCommand"`
|
||||
StopCommand string `json:"stopCommand"`
|
||||
StatusCommand string `json:"statusCommand"`
|
||||
}
|
||||
|
||||
type ServerDeploymentDispatchEvidenceBody struct {
|
||||
JobID string `json:"jobId"`
|
||||
JobState domain.JobState `json:"jobState"`
|
||||
DeploymentRevision int `json:"deploymentRevision"`
|
||||
DeploymentDefinitionIncluded bool `json:"deploymentDefinitionIncluded"`
|
||||
}
|
||||
|
||||
type ServerDeploymentProjectionBody struct {
|
||||
@@ -104,7 +122,18 @@ func (request ServerDeploymentRequest) deploymentDefinition() domain.ServerDeplo
|
||||
}
|
||||
|
||||
func ServerDeploymentFromDomain(view domain.ServerDeploymentView) ServerDeploymentResponse {
|
||||
return ServerDeploymentResponse{ServerInstanceID: view.ServerInstanceID, Mode: view.Mode, ProfileKey: view.ProfileKey, CreateInputs: domain.CopyStringMap(view.CreateInputs), ServerRootConfigured: view.ServerRootConfigured, WorkingDirectoryConfigured: view.WorkingDirectoryConfigured, InstallCommandConfigured: view.InstallCommandConfigured, StartCommandConfigured: view.StartCommandConfigured, StopCommandConfigured: view.StopCommandConfigured, StatusCommandConfigured: view.StatusCommandConfigured, Shell: view.Shell, Revision: view.Revision, UpdatedAt: optionalTime(view.UpdatedAt), Projection: deploymentProjectionFromDomain(view.Projection)}
|
||||
return ServerDeploymentResponse{ServerInstanceID: view.ServerInstanceID, Mode: view.Mode, ProfileKey: view.ProfileKey, CreateInputs: domain.CopyStringMap(view.CreateInputs), ServerRootConfigured: view.ServerRootConfigured, WorkingDirectoryConfigured: view.WorkingDirectoryConfigured, InstallCommandConfigured: view.InstallCommandConfigured, StartCommandConfigured: view.StartCommandConfigured, StopCommandConfigured: view.StopCommandConfigured, StatusCommandConfigured: view.StatusCommandConfigured, Shell: view.Shell, Revision: view.Revision, UpdatedAt: optionalTime(view.UpdatedAt), Projection: deploymentProjectionFromDomain(view.Projection), LatestDispatch: deploymentDispatchEvidenceFromDomain(view.LatestDispatch)}
|
||||
}
|
||||
|
||||
func ServerDeploymentRevealFromDomain(reveal domain.ServerDeploymentReveal) ServerDeploymentRevealResponse {
|
||||
return ServerDeploymentRevealResponse{ServerInstanceID: reveal.ServerInstanceID, ServerRoot: reveal.ServerRoot, WorkingDirectory: reveal.WorkingDirectory, InstallCommand: reveal.InstallCommand, StartCommand: reveal.StartCommand, StopCommand: reveal.StopCommand, StatusCommand: reveal.StatusCommand}
|
||||
}
|
||||
|
||||
func deploymentDispatchEvidenceFromDomain(evidence *domain.ServerDeploymentDispatchEvidence) *ServerDeploymentDispatchEvidenceBody {
|
||||
if evidence == nil {
|
||||
return nil
|
||||
}
|
||||
return &ServerDeploymentDispatchEvidenceBody{JobID: evidence.JobID, JobState: evidence.JobState, DeploymentRevision: evidence.DeploymentRevision, DeploymentDefinitionIncluded: evidence.DeploymentDefinitionIncluded}
|
||||
}
|
||||
|
||||
func deploymentProjectionFromDomain(projection domain.ServerDeploymentProjection) ServerDeploymentProjectionBody {
|
||||
|
||||
Reference in New Issue
Block a user