Skip to content

chore: remove remote-repo-dir option #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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