Skip to content

Commit

Permalink
add StartBuildRequest.workdir field in CLI (#4444)
Browse files Browse the repository at this point in the history
  • Loading branch information
abe-winter authored Oct 10, 2024
1 parent a381f05 commit c3c93b0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const (
moduleBuildFlagPlatform = "platform"
moduleBuildFlagWait = "wait"
moduleBuildFlagToken = "token"
moduleBuildFlagWorkdir = "workdir"
moduleBuildFlagGroupLogs = "group-logs"
moduleBuildRestartOnly = "restart-only"
moduleBuildFlagNoBuild = "no-build"
Expand Down Expand Up @@ -1629,6 +1630,11 @@ Example:
Name: moduleBuildFlagToken,
Usage: "checkout token for private repos, not necessary for public repos",
},
&cli.StringFlag{
Name: moduleBuildFlagWorkdir,
Usage: "use this to indicate that your meta.json is in a subdirectory of your repo." + " --module flag should be relative to this",
Value: ".",
},
},
Action: ModuleBuildStartAction,
},
Expand Down
2 changes: 2 additions & 0 deletions cli/module_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ func (c *viamClient) moduleBuildStartAction(cCtx *cli.Context) error {

gitRef := cCtx.String(moduleBuildFlagRef)
token := cCtx.String(moduleBuildFlagToken)
workdir := cCtx.String(moduleBuildFlagWorkdir)
req := buildpb.StartBuildRequest{
Repo: manifest.URL,
Ref: &gitRef,
Platforms: platforms,
ModuleId: manifest.ModuleID,
ModuleVersion: version,
Token: &token,
Workdir: &workdir,
}
if err := c.ensureLoggedIn(); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ require (
go.uber.org/atomic v1.11.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.24.0
go.viam.com/api v0.1.345
go.viam.com/api v0.1.347
go.viam.com/test v1.1.1-0.20220913152726-5da9916c08a2
go.viam.com/utils v0.1.104
goji.io v2.0.2+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1607,8 +1607,8 @@ go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
go.viam.com/api v0.1.345 h1:QE7KWhkgIpclAG/aJSI3kIi6Mu5bLhutgrTLCy+QzfI=
go.viam.com/api v0.1.345/go.mod h1:5lpVRxMsKFCaahqsnJfPGwJ9baoQ6PIKQu3lxvy6Wtw=
go.viam.com/api v0.1.347 h1:A1kDle9+Im0OKnFmqmJXha+RMzzH2oBjykUQ8TuKvF0=
go.viam.com/api v0.1.347/go.mod h1:5lpVRxMsKFCaahqsnJfPGwJ9baoQ6PIKQu3lxvy6Wtw=
go.viam.com/test v1.1.1-0.20220913152726-5da9916c08a2 h1:oBiK580EnEIzgFLU4lHOXmGAE3MxnVbeR7s1wp/F3Ps=
go.viam.com/test v1.1.1-0.20220913152726-5da9916c08a2/go.mod h1:XM0tej6riszsiNLT16uoyq1YjuYPWlRBweTPRDanIts=
go.viam.com/utils v0.1.104 h1:UrO870aDYf48iw81Gts/r/9OaqNEpTKYF5tzQ2im5tw=
Expand Down

0 comments on commit c3c93b0

Please sign in to comment.