-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #512 from kool-dev/build-local-ping
Add ping during local build - handle timeouts/interruptions
- Loading branch information
Showing
6 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package api | ||
|
||
import "fmt" | ||
|
||
// DeployPingResponse holds data returned from the deploy endpoint | ||
type DeployPingResponse struct { | ||
ID int `json:"id"` | ||
Status string `json:"status"` | ||
} | ||
|
||
// DeployPing consumes the API endpoint to create a new deployment | ||
type DeployPing struct { | ||
Endpoint | ||
} | ||
|
||
// NewDeployPing creates a new DeployStart instance | ||
func NewDeployPing(created *DeployCreateResponse) (c *DeployPing) { | ||
c = &DeployPing{ | ||
Endpoint: NewDefaultEndpoint("POST"), | ||
} | ||
|
||
c.SetPath("deploy/ping") | ||
c.Body().Set("id", fmt.Sprintf("%d", created.Deploy.ID)) | ||
|
||
return | ||
} | ||
|
||
// Run calls deploy/ping in the Kool Dev API | ||
func (c *DeployPing) Run() (resp *DeployPingResponse, err error) { | ||
resp = &DeployPingResponse{} | ||
c.SetResponseReceiver(resp) | ||
err = c.DoCall() | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters