From b57f6cd381b86b5959a96ec4c453de8f05bceb19 Mon Sep 17 00:00:00 2001 From: Eliot Stocker Date: Tue, 12 Mar 2019 16:57:41 +0000 Subject: [PATCH 1/5] allow setting target url --- out_command.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/out_command.go b/out_command.go index aa90195..b8a1094 100644 --- a/out_command.go +++ b/out_command.go @@ -46,6 +46,10 @@ func (c *OutCommand) Run(sourceDir string, request OutRequest) (OutResponse, err Description: github.String(request.Params.Description), } + if request.Params.Target == "" { + newStatus.LogURL = github.String(request.Params.Target) + } + fmt.Fprintln(c.writer, "creating deployment status") _, err = c.github.CreateDeploymentStatus(*deployment.ID, newStatus) if err != nil { From 085bd162b6d8ad0ba6af0fc6f06ff535e92dd264 Mon Sep 17 00:00:00 2001 From: Eliot Stocker Date: Thu, 14 Mar 2019 14:03:20 +0100 Subject: [PATCH 2/5] Fix some messed up formatting --- resources.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources.go b/resources.go index 4fd8fd7..a9402e9 100644 --- a/resources.go +++ b/resources.go @@ -51,6 +51,7 @@ type OutResponse struct { type OutParams struct { Type string `json:"type"` ID string + Target string Ref string Environment string Task string @@ -60,6 +61,7 @@ type OutParams struct { PayloadPath string `json:"payload_path"` RawID json.RawMessage `json:"id"` + RawTarget json.RawMessage `json:"target"` RawState json.RawMessage `json:"state"` RawRef json.RawMessage `json:"ref"` RawTask json.RawMessage `json:"task"` @@ -102,6 +104,10 @@ func (p *OutParams) UnmarshalJSON(b []byte) (err error) { p.Description = getStringOrStringFromFile(p.RawDescription) } + if p.RawTarget != nil { + p.Target = getStringOrStringFromFile(p.RawTarget) + } + var payload map[string]interface{} json.Unmarshal(p.RawPayload, &payload) From 496b4cfe2b9ae1de4c1e4398b6bcae13d478c879 Mon Sep 17 00:00:00 2001 From: Eliot Stocker Date: Mon, 16 Sep 2019 14:20:05 +0100 Subject: [PATCH 3/5] chore: switch log url to environment url --- deployment_out_command.go | 1 + out_command.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deployment_out_command.go b/deployment_out_command.go index bcb91e2..eb9cb97 100644 --- a/deployment_out_command.go +++ b/deployment_out_command.go @@ -33,6 +33,7 @@ func (c *DeploymentOutCommand) Run(sourceDir string, request OutRequest) (OutRes newDeployment := &github.DeploymentRequest{ Ref: github.String(request.Params.Ref), RequiredContexts: &[]string{}, + AutoMerge: false } concoursePayload := map[string]interface{}{ diff --git a/out_command.go b/out_command.go index b8a1094..8654617 100644 --- a/out_command.go +++ b/out_command.go @@ -46,8 +46,8 @@ func (c *OutCommand) Run(sourceDir string, request OutRequest) (OutResponse, err Description: github.String(request.Params.Description), } - if request.Params.Target == "" { - newStatus.LogURL = github.String(request.Params.Target) + if request.Params.Target != "" { + newStatus.EnvironmentURL = github.String(request.Params.Target) } fmt.Fprintln(c.writer, "creating deployment status") From c2a9fdcd4b6164382b242cb3d643ff530ee0af0e Mon Sep 17 00:00:00 2001 From: Eliot Stocker Date: Mon, 16 Sep 2019 14:22:42 +0100 Subject: [PATCH 4/5] chore: fix formatting again --- resources.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources.go b/resources.go index a9402e9..0ef8329 100644 --- a/resources.go +++ b/resources.go @@ -61,7 +61,7 @@ type OutParams struct { PayloadPath string `json:"payload_path"` RawID json.RawMessage `json:"id"` - RawTarget json.RawMessage `json:"target"` + RawTarget json.RawMessage `json:"target"` RawState json.RawMessage `json:"state"` RawRef json.RawMessage `json:"ref"` RawTask json.RawMessage `json:"task"` @@ -105,8 +105,8 @@ func (p *OutParams) UnmarshalJSON(b []byte) (err error) { } if p.RawTarget != nil { - p.Target = getStringOrStringFromFile(p.RawTarget) - } + p.Target = getStringOrStringFromFile(p.RawTarget) + } var payload map[string]interface{} json.Unmarshal(p.RawPayload, &payload) From f1a291e9257eb72f0e0ac353debd0495a900e82b Mon Sep 17 00:00:00 2001 From: Eliot Stocker Date: Tue, 17 Sep 2019 09:53:45 +0100 Subject: [PATCH 5/5] chore: remove automerge in favor of #17 --- deployment_out_command.go | 1 - 1 file changed, 1 deletion(-) diff --git a/deployment_out_command.go b/deployment_out_command.go index eb9cb97..bcb91e2 100644 --- a/deployment_out_command.go +++ b/deployment_out_command.go @@ -33,7 +33,6 @@ func (c *DeploymentOutCommand) Run(sourceDir string, request OutRequest) (OutRes newDeployment := &github.DeploymentRequest{ Ref: github.String(request.Params.Ref), RequiredContexts: &[]string{}, - AutoMerge: false } concoursePayload := map[string]interface{}{