Skip to content

Commit

Permalink
chore: remove remote-repo-dir option (#340)
Browse files Browse the repository at this point in the history
(cherry picked from commit b7781d8)
  • Loading branch information
mafredri authored and johnstcn committed Sep 26, 2024
1 parent 3d12008 commit c31fd00
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
4 changes: 2 additions & 2 deletions envbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func Run(ctx context.Context, opts options.Options) error {
if err != nil {
return fmt.Errorf("git clone options: %w", err)
}
cloneOpts.Path = opts.RemoteRepoDir
cloneOpts.Path = magicDir.Join("repo")

endStage := startStage("📦 Remote repo build mode enabled, cloning %s to %s for build context...",
newColor(color.FgCyan).Sprintf(opts.GitURL),
Expand Down Expand Up @@ -927,7 +927,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error)
if err != nil {
return nil, fmt.Errorf("git clone options: %w", err)
}
cloneOpts.Path = opts.RemoteRepoDir
cloneOpts.Path = magicDir.Join("repo")

endStage := startStage("📦 Remote repo build mode enabled, cloning %s to %s for build context...",
newColor(color.FgCyan).Sprintf(opts.GitURL),
Expand Down
3 changes: 0 additions & 3 deletions options/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ func (o *Options) SetDefaults() {
if o.WorkspaceFolder == "" {
o.WorkspaceFolder = DefaultWorkspaceFolder(o.GitURL)
}
if o.RemoteRepoDir == "" {
o.RemoteRepoDir = magicdir.Default.Join("repo")
}
if o.BinaryPath == "" {
o.BinaryPath = "/.envbuilder/bin/envbuilder"
}
Expand Down
1 change: 0 additions & 1 deletion options/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func TestOptions_SetDefaults(t *testing.T) {
GitURL: "",
WorkspaceFolder: options.EmptyWorkspaceDir,
MagicDirBase: "/.envbuilder",
RemoteRepoDir: "/.envbuilder/repo",
BinaryPath: "/.envbuilder/bin/envbuilder",
}

Expand Down
12 changes: 0 additions & 12 deletions options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ type Options struct {
// working on the same repository.
RemoteRepoBuildMode bool

// RemoteRepoDir is the destination directory for the cloned repo when using
// remote repo build mode.
RemoteRepoDir string

// BinaryPath is the path to the local envbuilder binary when
// attempting to probe the build cache. This is only relevant when
// GetCachedImage is true.
Expand Down Expand Up @@ -459,14 +455,6 @@ func (o *Options) CLI() serpent.OptionSet {
"be used to improving cache utilization when multiple users are building " +
"working on the same repository.",
},
{
Flag: "remote-repo-dir",
Env: WithEnvPrefix("REMOTE_REPO_DIR"),
Value: serpent.StringOf(&o.RemoteRepoDir),
// Default: magicdir.Default.Join("repo"), // TODO: reinstate once legacy opts are removed.
Hidden: true,
Description: "Specify the destination directory for the cloned repo when using remote repo build mode.",
},
{
Flag: "verbose",
Env: WithEnvPrefix("VERBOSE"),
Expand Down

0 comments on commit c31fd00

Please sign in to comment.