Skip to content

Commit

Permalink
feat(Projects): Support for buildCommand, outputDirectory, commandFor…
Browse files Browse the repository at this point in the history
…IgnoringBuildStep
  • Loading branch information
ShaunEgan authored Aug 16, 2021
1 parent be14837 commit 5bd91c9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 24 deletions.
54 changes: 33 additions & 21 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ type GetProjectsResponse struct {
}

type Project struct {
Id string `json:"id"`
Name string `json:"name"`
Framework string `json:"framework"`
RootDirectory string `json:"rootDirectory"`
NodeVersion string `json:"nodeVersion"`
AccountId string `json:"accountId"`
UpdatedAt int64 `json:"updatedAt"`
CreatedAt int64 `json:"createdAt"`
Alias []*Domain `json:"alias"`
Link *RepositoryLink `json:"link"`
Id string `json:"id"`
Name string `json:"name"`
Framework string `json:"framework"`
RootDirectory string `json:"rootDirectory"`
NodeVersion string `json:"nodeVersion"`
AccountId string `json:"accountId"`
UpdatedAt int64 `json:"updatedAt"`
CreatedAt int64 `json:"createdAt"`
Alias []*Domain `json:"alias"`
Link *RepositoryLink `json:"link"`
BuildCommand string `json:"buildCommand"`
OutputDirectory string `json:"outputDirectory"`
CommandForIgnoringBuildStep string `json:"commandForIgnoringBuildStep,omitempty"`
}

type RepositoryLink struct {
Expand All @@ -33,18 +36,24 @@ type RepositoryLink struct {
}

type CreateProjectOptions struct {
Name string
Framework string
RepositoryType string
RepositoryName string
RootDirectory string
Name string
Framework string
RepositoryType string
RepositoryName string
RootDirectory string
BuildCommand string
OutputDirectory string
CommandForIgnoringBuildStep string
}

type CreateProjectRequest struct {
Name string `json:"name"`
Framework string `json:"framework"`
RootDirectory *string `json:"rootDirectory"`
GitRepository *GitRepositoryRequest `json:"gitRepository,omitempty"`
Name string `json:"name"`
Framework string `json:"framework"`
RootDirectory *string `json:"rootDirectory"`
GitRepository *GitRepositoryRequest `json:"gitRepository,omitempty"`
BuildCommand string `json:"buildCommand"`
OutputDirectory string `json:"outputDirectory"`
CommandForIgnoringBuildStep string `json:"commandForIgnoringBuildStep,omitempty"`
}

type GitRepositoryRequest struct {
Expand All @@ -53,8 +62,11 @@ type GitRepositoryRequest struct {
}

type UpdateProjectRequest struct {
Framework string `json:"framework"`
RootDirectory *string `json:"rootDirectory"`
Framework string `json:"framework"`
RootDirectory *string `json:"rootDirectory"`
BuildCommand string `json:"buildCommand"`
OutputDirectory string `json:"outputDirectory"`
CommandForIgnoringBuildStep string `json:"commandForIgnoringBuildStep"`
}

type CreateProjectEnvRequest struct {
Expand Down
12 changes: 9 additions & 3 deletions projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ func (p *ProjectApi) CreateProject(ctx context.Context, options *CreateProjectOp
u := p.baseUrl.ResolveReference(rel)

body := &CreateProjectRequest{
Name: options.Name,
Framework: options.Framework,
Name: options.Name,
Framework: options.Framework,
BuildCommand: options.BuildCommand,
OutputDirectory: options.OutputDirectory,
CommandForIgnoringBuildStep: options.CommandForIgnoringBuildStep,
}

if options.RepositoryType != "" && options.RepositoryName != "" {
Expand Down Expand Up @@ -88,7 +91,10 @@ func (p *ProjectApi) UpdateProject(ctx context.Context, name string, project *Pr
u := p.baseUrl.ResolveReference(rel)

body := &UpdateProjectRequest{
Framework: project.Framework,
Framework: project.Framework,
BuildCommand: project.BuildCommand,
OutputDirectory: project.OutputDirectory,
CommandForIgnoringBuildStep: project.CommandForIgnoringBuildStep,
}

if project.RootDirectory != "" {
Expand Down

0 comments on commit 5bd91c9

Please sign in to comment.