Rediģēt

Kopīgot, izmantojot


gulp@0 - gulp v0 task

Use this task to run the gulp Node.js streaming task-based build system.

Node.js streaming task based build system.

Syntax

# gulp v0
# Run the gulp Node.js streaming task-based build system.
- task: gulp@0
  inputs:
    gulpFile: 'gulpfile.js' # string. Required. gulp File Path. Default: gulpfile.js.
    #targets: # string. gulp Task(s). 
    #arguments: # string. Arguments. 
  # Advanced
    #workingDirectory: # string. Alias: cwd. Working Directory. 
    gulpjs: 'node_modules/gulp/bin/gulp.js' # string. Required. gulp.js location. Default: node_modules/gulp/bin/gulp.js.
  # JUnit Test Results
    #publishJUnitResults: false # boolean. Publish to Azure Pipelines. Default: false.
    #testResultsFiles: '**/TEST-*.xml' # string. Required when publishJUnitResults = true. Test Results Files. Default: **/TEST-*.xml.
    #testRunTitle: # string. Optional. Use when publishJUnitResults = true. Test Run Title. 
  # Code Coverage
    #enableCodeCoverage: false # boolean. Enable code Coverage. Default: false.
    #testFramework: 'Mocha' # 'Mocha' | 'Jasmine'. Optional. Use when enableCodeCoverage = true. Test Framework. Default: Mocha.
    #srcFiles: # string. Optional. Use when enableCodeCoverage = true. Source Files. 
    #testFiles: 'test/*.js' # string. Required when enableCodeCoverage = true. Test Script Files. Default: test/*.js.
# Gulp v0
# Node.js streaming task based build system.
- task: Gulp@0
  inputs:
    gulpFile: 'gulpfile.js' # string. Required. Gulp File Path. Default: gulpfile.js.
    #targets: # string. Gulp Task(s). 
    #arguments: # string. Arguments. 
  # Advanced
    #workingDirectory: # string. Alias: cwd. Working Directory. 
    gulpjs: 'node_modules/gulp/bin/gulp.js' # string. Required. gulp.js location. Default: node_modules/gulp/bin/gulp.js.
  # JUnit Test Results
    #publishJUnitResults: false # boolean. Publish to Azure Pipelines/TFS. Default: false.
    #testResultsFiles: '**/TEST-*.xml' # string. Required when publishJUnitResults = true. Test Results Files. Default: **/TEST-*.xml.
    #testRunTitle: # string. Optional. Use when publishJUnitResults = true. Test Run Title. 
  # Code Coverage
    #enableCodeCoverage: false # boolean. Enable code Coverage. Default: false.
    #testFramework: 'Mocha' # 'Mocha' | 'Jasmine'. Optional. Use when enableCodeCoverage = true. Test Framework. Default: Mocha.
    #srcFiles: # string. Optional. Use when enableCodeCoverage = true. Source Files. 
    #testFiles: 'test/*.js' # string. Required when enableCodeCoverage = true. Test Script Files. Default: test/*.js.

Inputs

gulpFile - gulp File Path
string. Required. Default value: gulpfile.js.

The relative path from the repo root of the gulp file script file you want to run.


gulpFile - Gulp File Path
string. Required. Default value: gulpfile.js.

The relative path from the repo root of the gulp file script file you want to run.


targets - gulp Task(s)
string.

Optional space-delimited list of tasks to run. If this input isn't specified, the default task will run.


targets - Gulp Task(s)
string.

Optional space-delimited list of tasks to run. If this input isn't specified, the default task will run.


arguments - Arguments
string.

Additional arguments passed to gulp. --gulpfile is not needed since it's already added via gulpFile input above.


workingDirectory - Working Directory
Input alias: cwd. string.

The current working directory to use when the script is run. This input defaults to the folder where the script is located.


gulpjs - gulp.js location
string. Required. Default value: node_modules/gulp/bin/gulp.js.

Runs gulp.js when the agent can't find global-installed gulp. This input defaults to the gulp.js installed under the node_modules folder of the working directory.


publishJUnitResults - Publish to Azure Pipelines
boolean. Default value: false.

Publishes JUnit test results from the gulp build to Azure Pipelines/TFS.


publishJUnitResults - Publish to Azure Pipelines/TFS
boolean. Default value: false.

Publishes JUnit test results from the gulp build to Azure Pipelines/TFS.


testResultsFiles - Test Results Files
string. Required when publishJUnitResults = true. Default value: **/TEST-*.xml.

The test results files path. You can use wildcards. For example, you can use **/TEST-*.xml for all XML files whose name starts with TEST-.


testRunTitle - Test Run Title
string. Optional. Use when publishJUnitResults = true.

Provides a name for the test run.


enableCodeCoverage - Enable code Coverage
boolean. Default value: false.

Enables Code Coverage using Istanbul.


testFramework - Test Framework
string. Optional. Use when enableCodeCoverage = true. Allowed values: Mocha, Jasmine. Default value: Mocha.

Specifies your test framework.


srcFiles - Source Files
string. Optional. Use when enableCodeCoverage = true.

Provides the path to the source files that you want to hookRequire().


testFiles - Test Script Files
string. Required when enableCodeCoverage = true. Default value: test/*.js.

Provides the path to your test script files.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

Note

THere is a newer version of this task available at gulp@1.

Use this task to run gulp tasks using the Node.js streaming task-based build system.

Note

Gulp is not preinstalled on all hosted agents. See installed software on virtual machine images.

Examples

Run gulp.js

- task: Npm@1
  inputs:
    command: 'install'

- task: gulp@0
  inputs:
    gulpFile: 'gulpfile.js'
    gulpjs: 'node_modules/gulp/bin/gulp.js'

Build a Node.js app

Requirements

Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: node.js
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.91.0 or greater
Task category Build