feat: add --no-cache flag to ps:rebuild
The `ps:rebuild` command now accepts `--no-cache` to perform a single uncached build regardless of builder, without persisting any setting for later deploys. The railpack builder now also honors `--no-cache` when set via `docker-options`, and build records are now correctly attributed when flags precede the app name.
This commit is contained in:
27 files changed
+316
-9
No files matched your search
@@ -19,7 +19,7 @@ Additional commands:`
|
||||
|
||||
helpContent = `
|
||||
ps:inspect <app>, Displays a sanitized version of docker inspect for an app
|
||||
ps:rebuild [--parallel count] [--all|<app>], Rebuilds an app from source
|
||||
ps:rebuild [--parallel count] [--no-cache] [--all|<app>], Rebuilds an app from source
|
||||
ps:report [<app>] [<flag>], Displays a process report for one or more apps
|
||||
ps:restart [--parallel count] [--all|<app>] [<process-name>], Restart an app
|
||||
ps:restore [<app>], Start previously running apps e.g. after reboot
|
||||
|
||||
@@ -27,9 +27,10 @@ func main() {
|
||||
args := flag.NewFlagSet("ps:rebuild", flag.ExitOnError)
|
||||
allApps := args.Bool("all", false, "--all: rebuild all apps")
|
||||
parallelCount := args.Int("parallel", ps.RunInSerial, "--parallel: number of apps to rebuild in parallel, -1 to match cpu count")
|
||||
noCache := args.Bool("no-cache", false, "--no-cache: rebuild without using the build cache")
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
err = ps.CommandRebuild(appName, *allApps, *parallelCount)
|
||||
err = ps.CommandRebuild(appName, *allApps, *parallelCount, *noCache)
|
||||
case "report":
|
||||
args := flag.NewFlagSet("ps:report", flag.ExitOnError)
|
||||
format := args.String("format", "stdout", "format: [ stdout | json ]")
|
||||
|
||||
@@ -3,6 +3,7 @@ package ps
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@@ -26,7 +27,11 @@ func CommandInspect(appName string) error {
|
||||
}
|
||||
|
||||
// CommandRebuild rebuilds an app from source
|
||||
func CommandRebuild(appName string, allApps bool, parallelCount int) error {
|
||||
func CommandRebuild(appName string, allApps bool, parallelCount int, noCache bool) error {
|
||||
if noCache {
|
||||
os.Setenv("DOKKU_BUILD_NO_CACHE", "true")
|
||||
}
|
||||
|
||||
if allApps {
|
||||
return common.RunCommandAgainstAllApps(Rebuild, "rebuild", parallelCount)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user