Skip to content

Commit 327baa7

Browse files
authored
Merge pull request #14 from netlify/draft_deploy
Add fields to support draft deploys.
2 parents 959ad8e + edfb8c2 commit 327baa7

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

go/models/deploy.go

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ type Deploy struct {
3232
*/
3333
DeployURL string `json:"deploy_url,omitempty"`
3434

35+
/* draft
36+
*/
37+
Draft bool `json:"draft,omitempty"`
38+
3539
/* id
3640
*/
3741
ID string `json:"id,omitempty"`

go/models/deploy_files.go

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ type DeployFiles struct {
1515
*/
1616
Async bool `json:"async,omitempty"`
1717

18+
/* draft
19+
*/
20+
Draft bool `json:"draft,omitempty"`
21+
1822
/* files
1923
*/
2024
Files interface{} `json:"files,omitempty"`

go/porcelain/deploy.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (n *Netlify) overCommitted(d *deployFiles) bool {
7676

7777
// DeploySite creates a new deploy for a site given a directory in the filesystem.
7878
// It uploads the necessary files that changed between deploys.
79-
func (n *Netlify) DeploySite(ctx context.Context, siteID, dir string) (*models.Deploy, error) {
79+
func (n *Netlify) DeploySite(ctx context.Context, siteID, dir string, draft bool) (*models.Deploy, error) {
8080
f, err := os.Stat(dir)
8181
if err != nil {
8282
return nil, err
@@ -90,12 +90,13 @@ func (n *Netlify) DeploySite(ctx context.Context, siteID, dir string) (*models.D
9090
return nil, err
9191
}
9292

93-
return n.createDeploy(ctx, siteID, files)
93+
return n.createDeploy(ctx, siteID, draft, files)
9494
}
9595

96-
func (n *Netlify) createDeploy(ctx context.Context, siteID string, files *deployFiles) (*models.Deploy, error) {
96+
func (n *Netlify) createDeploy(ctx context.Context, siteID string, draft bool, files *deployFiles) (*models.Deploy, error) {
9797
deployFiles := &models.DeployFiles{
9898
Files: files.Sums,
99+
Draft: draft,
99100
Async: n.overCommitted(files),
100101
}
101102
l := context.GetLogger(ctx)

swagger.yml

+4
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,8 @@ definitions:
742742
type: string
743743
review_id:
744744
type: string
745+
draft:
746+
type: boolean
745747
required:
746748
type: array
747749
items:
@@ -757,6 +759,8 @@ definitions:
757759
properties:
758760
files:
759761
type: object
762+
draft:
763+
type: boolean
760764
async:
761765
type: boolean
762766
metadata:

ui/swagger.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)