Skip to content

Commit

Permalink
set max_old_space_size option for js-build (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjoey authored Jul 21, 2023
1 parent 6f98675 commit ca7e04d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actions/js-build/1.0/dice.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### job 配置项
jobs:
js-build:
image: registry.erda.cloud/erda-actions/js-build-action:1.0-20230427162436-685950d
image: registry.erda.cloud/erda-actions/js-build-action:1.0-20230710105441-b9ad3492
envs:
BP_DOCKER_BASE_REGISTRY: registry.erda.cloud
resources:
Expand Down
6 changes: 6 additions & 0 deletions actions/js-build/1.0/internal/pkg/build/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ func runCommand(cmd string) error {
command := exec.Command("/bin/bash", "-c", cmd)
command.Stdout = os.Stdout
command.Stderr = os.Stderr
memory := os.Getenv("PIPELINE_LIMITED_MEM")
if memory == "" {
memory = "2048"
}
command.Env = append(command.Environ(), fmt.Sprintf("NODE_OPTIONS=--max-old-space-size=%s",
memory))
if err := command.Run(); err != nil {
return err
}
Expand Down

0 comments on commit ca7e04d

Please sign in to comment.