diff --git a/README.md b/README.md index 6c39376798e495245aaa6a6352f097476122ea02..42807eccbb4431345c78c8a6dee63fc9a75e0d51 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ This job is bound to the `build` stage, and uses the following variables: | Input / Variable | Description | Default value | |-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| -| `NODE_BUILD_DISABLED` | Set to `true` to disable build | _none_ (enabled) | +| `build-disabled` / `NODE_BUILD_DISABLED` | Set to `true` to disable build | _none_ (enabled) | | `build-dir` / `NODE_BUILD_DIR` | Variable to define build directory | `dist` | | `build-args` / `NODE_BUILD_ARGS` | npm [run script](https://docs.npmjs.com/cli/v8/commands/npm-run-script) arguments <br/> yarn [run script](https://classic.yarnpkg.com/en/docs/cli/run) arguments <br/> pnpm [run script](https://pnpm.io/cli/run) arguments <br/>⚠ default value should be overridden for `pnpm` as `--prod` is not a valid option. | `run build --prod` | | `test-args` / `NODE_TEST_ARGS` | npm [test](https://docs.npmjs.com/cli/v8/commands/npm-test) arguments <br/> yarn [test](https://classic.yarnpkg.com/en/docs/cli/test) arguments <br/> pnpm [test](https://pnpm.io/cli/test) arguments | `test -- --coverage` | diff --git a/kicker.json b/kicker.json index cd8190294b6563c86805b6ed7c2dabc9c2772835..fe6d12dbc5bfbf832a72c3155a0b172ffceadb01 100644 --- a/kicker.json +++ b/kicker.json @@ -42,6 +42,13 @@ "description": "Space separated list of NPM [scoped registries](https://docs.npmjs.com/cli/v8/using-npm/scope#associating-a-scope-with-a-registry) (formatted as `@somescope:https://some.npm.registry/some/repo @anotherscope:https://another.npm.registry/another/repo`)", "advanced": true }, + { + "name": "NODE_BUILD_DISABLED", + "description": "Set to true to disable build", + "default": "false", + "type": "boolean", + "advanced": true + }, { "name": "NODE_BUILD_ARGS", "description": "npm [run script](https://docs.npmjs.com/cli/v8/commands/npm-run-script) arguments - yarn [run script](https://classic.yarnpkg.com/en/docs/cli/run) arguments - pnpm [run script](https://pnpm.io/cli/run) arguments\n\n⚠ default value should be overridden for `pnpm` as `--prod` is not a valid option", diff --git a/templates/gitlab-ci-node.yml b/templates/gitlab-ci-node.yml index f51249a3fcbde90fbfe3a54b92329860a026c0c4..f048d03cbd13e2efa5acef75e7a7764a24b0a3f0 100644 --- a/templates/gitlab-ci-node.yml +++ b/templates/gitlab-ci-node.yml @@ -39,6 +39,10 @@ spec: config-scoped-registries: description: Space separated list of NPM [scoped registries](https://docs.npmjs.com/cli/v8/using-npm/scope#associating-a-scope-with-a-registry) (formatted as `@somescope:https://some.npm.registry/some/repo @anotherscope:https://another.npm.registry/another/repo`) default: '' + build-disabled: + description: Set to true to disable build + type: boolean + default: false build-args: description: |- npm [run script](https://docs.npmjs.com/cli/v8/commands/npm-run-script) arguments - yarn [run script](https://classic.yarnpkg.com/en/docs/cli/run) arguments - pnpm [run script](https://pnpm.io/cli/run) arguments @@ -179,6 +183,7 @@ variables: NODE_LINT_ENABLED: $[[ inputs.lint-enabled ]] NODE_LINT_ARGS: $[[ inputs.lint-args ]] # Node build + NODE_BUILD_DISABLED: $[[ inputs.build-disabled ]] NODE_BUILD_ARGS: $[[ inputs.build-args ]] # Node test NODE_TEST_ARGS: $[[ inputs.test-args ]] @@ -674,7 +679,8 @@ node-build: expire_in: 1 day rules: # always if $NODE_BUILD_DISABLED not set - - if: '$NODE_BUILD_DISABLED != "true"' + - if: '$NODE_BUILD_DISABLED == "true"' + when: never - !reference [.test-policy, rules] node-lint: