Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
deprecate experimental flag and support runner version flag for push cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
aavshr committed Dec 12, 2023
1 parent 2ecc20e commit 2a4edfe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions cmd/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ being uploaded during push.
pushTag, _ := cmd.Flags().GetString("tag")
openInBrowser, _ := cmd.Flags().GetBool("open")
skipLogs, _ := cmd.Flags().GetBool("skip-logs")
experimental, _ := cmd.Flags().GetBool("experimental")
runnerVersion, _ := cmd.Flags().GetString("runner-version")

return push(projectID, projectDir, pushTag, openInBrowser, skipLogs, experimental)
return push(projectID, projectDir, pushTag, runnerVersion, openInBrowser, skipLogs)
},
}

Expand All @@ -66,13 +66,13 @@ being uploaded during push.
cmd.Flags().StringP("tag", "t", "", "tag to identify this push")
cmd.Flags().Bool("open", false, "open builder instance/project in browser after push")
cmd.Flags().BoolP("skip-logs", "", false, "skip following logs after push")
cmd.Flags().BoolP("experimental", "", false, "use experimental builds")
cmd.Flags().MarkHidden("experimental")
cmd.Flags().StringP("runner-version", "", "", "runner version to use for this push")
cmd.Flags().MarkHidden("runner-version")

return cmd
}

func push(projectID, projectDir, pushTag string, openInBrowser, skipLogs, experimental bool) error {
func push(projectID, projectDir, pushTag, runnerVersion string, openInBrowser, skipLogs bool) error {
utils.Logger.Printf("Validating your Spacefile...")

s, err := spacefile.LoadSpacefile(projectDir)
Expand All @@ -88,7 +88,7 @@ func push(projectID, projectDir, pushTag string, openInBrowser, skipLogs, experi
return fmt.Errorf("failed to zip your project, %w", err)
}

build, err := utils.Client.CreateBuild(&api.CreateBuildRequest{AppID: projectID, Tag: pushTag, Experimental: experimental, AutoPWA: *s.AutoPWA})
build, err := utils.Client.CreateBuild(&api.CreateBuildRequest{AppID: projectID, Tag: pushTag, RunnerVersion: runnerVersion, AutoPWA: *s.AutoPWA})
if err != nil {
return fmt.Errorf("failed to start a build, %w", err)
}
Expand Down
8 changes: 4 additions & 4 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ func (c *DetaClient) GetRevisions(r *GetRevisionsRequest) (*GetRevisionsResponse
}

type CreateBuildRequest struct {
AppID string `json:"app_id"`
Tag string `json:"tag"`
Experimental bool `json:"experimental"`
AutoPWA bool `json:"auto_pwa"`
AppID string `json:"app_id"`
Tag string `json:"tag"`
RunnerVersion string `json:"runner_version"`
AutoPWA bool `json:"auto_pwa"`
}

type CreateBuildResponse struct {
Expand Down

0 comments on commit 2a4edfe

Please sign in to comment.