mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-21 22:21:41 +00:00
release/dist/cli: add option to override out path
Allow builds to be outputted to a specific directory. By default, or if unset, artifacts are written to PWD/dist. Updates tailscale/corp#27638 Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
f28c8d0ec0
commit
e84522e3e3
8
release/dist/cli/cli.go
vendored
8
release/dist/cli/cli.go
vendored
@ -65,6 +65,7 @@ func CLI(getTargets func() ([]dist.Target, error)) *ffcli.Command {
|
|||||||
fs.StringVar(&buildArgs.manifest, "manifest", "", "manifest file to write")
|
fs.StringVar(&buildArgs.manifest, "manifest", "", "manifest file to write")
|
||||||
fs.BoolVar(&buildArgs.verbose, "verbose", false, "verbose logging")
|
fs.BoolVar(&buildArgs.verbose, "verbose", false, "verbose logging")
|
||||||
fs.StringVar(&buildArgs.webClientRoot, "web-client-root", "", "path to root of web client source to build")
|
fs.StringVar(&buildArgs.webClientRoot, "web-client-root", "", "path to root of web client source to build")
|
||||||
|
fs.StringVar(&buildArgs.outPath, "out", "", "path to write output artifacts (defaults to '$PWD/dist' if not set)")
|
||||||
return fs
|
return fs
|
||||||
})(),
|
})(),
|
||||||
LongHelp: strings.TrimSpace(`
|
LongHelp: strings.TrimSpace(`
|
||||||
@ -156,6 +157,7 @@ var buildArgs struct {
|
|||||||
manifest string
|
manifest string
|
||||||
verbose bool
|
verbose bool
|
||||||
webClientRoot string
|
webClientRoot string
|
||||||
|
outPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
func runBuild(ctx context.Context, filters []string, targets []dist.Target) error {
|
func runBuild(ctx context.Context, filters []string, targets []dist.Target) error {
|
||||||
@ -172,7 +174,11 @@ func runBuild(ctx context.Context, filters []string, targets []dist.Target) erro
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("getting working directory: %w", err)
|
return fmt.Errorf("getting working directory: %w", err)
|
||||||
}
|
}
|
||||||
b, err := dist.NewBuild(wd, filepath.Join(wd, "dist"))
|
outPath := filepath.Join(wd, "dist")
|
||||||
|
if buildArgs.outPath != "" {
|
||||||
|
outPath = buildArgs.outPath
|
||||||
|
}
|
||||||
|
b, err := dist.NewBuild(wd, outPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("creating build context: %w", err)
|
return fmt.Errorf("creating build context: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user