diff --git a/cmd/npmExecuteScripts_generated.go b/cmd/npmExecuteScripts_generated.go index c282734d86..223a84c5dc 100644 --- a/cmd/npmExecuteScripts_generated.go +++ b/cmd/npmExecuteScripts_generated.go @@ -266,7 +266,7 @@ func addNpmExecuteScriptsFlags(cmd *cobra.Command, stepConfig *npmExecuteScripts cmd.Flags().BoolVar(&stepConfig.Install, "install", true, "Run npm install or similar commands depending on the project structure.") cmd.Flags().StringSliceVar(&stepConfig.RunScripts, "runScripts", []string{}, "List of additional run scripts to execute from package.json.") cmd.Flags().StringVar(&stepConfig.DefaultNpmRegistry, "defaultNpmRegistry", os.Getenv("PIPER_defaultNpmRegistry"), "URL of the npm registry to use. Defaults to https://registry.npmjs.org/") - cmd.Flags().BoolVar(&stepConfig.VirtualFrameBuffer, "virtualFrameBuffer", false, "(Linux only) Start a virtual frame buffer in the background. This allows you to run a web browser without the need for an X server. Note that xvfb needs to be installed in the execution environment.") + cmd.Flags().BoolVar(&stepConfig.VirtualFrameBuffer, "virtualFrameBuffer", true, "(Linux only) Start a virtual frame buffer in the background. This allows you to run a web browser without the need for an X server. Note that xvfb needs to be installed in the execution environment.") cmd.Flags().StringSliceVar(&stepConfig.ScriptOptions, "scriptOptions", []string{}, "Options are passed to all runScripts calls separated by a '--'. './piper npmExecuteScripts --runScripts ci-e2e --scriptOptions '--tag1' will correspond to 'npm run ci-e2e -- --tag1'") cmd.Flags().StringSliceVar(&stepConfig.BuildDescriptorExcludeList, "buildDescriptorExcludeList", []string{`deployment/**`}, "List of build descriptors and therefore modules to exclude from execution of the npm scripts. The elements can either be a path to the build descriptor or a pattern.") cmd.Flags().StringSliceVar(&stepConfig.BuildDescriptorList, "buildDescriptorList", []string{}, "List of build descriptors and therefore modules for execution of the npm scripts. The elements have to be paths to the build descriptors. **If set, buildDescriptorExcludeList will be ignored.**") @@ -378,7 +378,7 @@ func npmExecuteScriptsMetadata() config.StepData { Type: "bool", Mandatory: false, Aliases: []config.Alias{}, - Default: false, + Default: true, }, { Name: "scriptOptions", diff --git a/integration/integration_npm_test.go b/integration/integration_npm_test.go index 08339eb1b7..81c3a97120 100644 --- a/integration/integration_npm_test.go +++ b/integration/integration_npm_test.go @@ -37,7 +37,7 @@ func TestNPMIntegrationRunScriptsWithOptions(t *testing.T) { //workaround to use test script util it is possible to set workdir for Exec call testScript := `#!/bin/sh cd /test -/piperbin/piper npmExecuteScripts --runScripts=start --scriptOptions=--tag,tag1 >test-log-runScriptWithOptions.txt 2>&1 +/piperbin/piper npmExecuteScripts --runScripts=start --virtualFrameBuffer=false --scriptOptions=--tag,tag1 >test-log-runScriptWithOptions.txt 2>&1 ` os.WriteFile(filepath.Join(tempDir, "runPiper.sh"), []byte(testScript), 0700) @@ -89,7 +89,7 @@ func TestNPMIntegrationRegistrySetInFlags(t *testing.T) { //workaround to use test script util it is possible to set workdir for Exec call testScript := `#!/bin/sh cd /test -/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --defaultNpmRegistry=https://foo.bar >test-log-registrySetInFlags.txt 2>&1 +/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --virtualFrameBuffer=false --defaultNpmRegistry=https://foo.bar >test-log-registrySetInFlags.txt 2>&1 ` os.WriteFile(filepath.Join(tempDir, "runPiper.sh"), []byte(testScript), 0700) @@ -140,7 +140,7 @@ func TestNPMIntegrationRegistrySetInNpmrc(t *testing.T) { //workaround to use test script util it is possible to set workdir for Exec call testScript := `#!/bin/sh cd /test -/piperbin/piper npmExecuteScripts --install --runScripts=ci-build >test-log-registrySetInNpmrc.txt 2>&1 +/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --virtualFrameBuffer=false >test-log-registrySetInNpmrc.txt 2>&1 ` os.WriteFile(filepath.Join(tempDir, "runPiper.sh"), []byte(testScript), 0700) @@ -191,7 +191,7 @@ func TestNPMIntegrationRegistryWithTwoModules(t *testing.T) { //workaround to use test script util it is possible to set workdir for Exec call testScript := `#!/bin/sh cd /test -/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --defaultNpmRegistry=https://foo.bar >test-log-registryWithTwoModules.txt 2>&1 +/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --virtualFrameBuffer=false --defaultNpmRegistry=https://foo.bar >test-log-registryWithTwoModules.txt 2>&1 ` os.WriteFile(filepath.Join(tempDir, "runPiper.sh"), []byte(testScript), 0700) diff --git a/resources/metadata/npmExecuteScripts.yaml b/resources/metadata/npmExecuteScripts.yaml index 75a9aa4f2b..607f2edf7d 100644 --- a/resources/metadata/npmExecuteScripts.yaml +++ b/resources/metadata/npmExecuteScripts.yaml @@ -114,6 +114,7 @@ spec: - PARAMETERS - STAGES - STEPS + default: true - name: scriptOptions type: "[]string" description: Options are passed to all runScripts calls separated by a '--'. './piper npmExecuteScripts --runScripts ci-e2e --scriptOptions '--tag1' will correspond to 'npm run ci-e2e -- --tag1'