Grunt@0 - Grunt v0 작업

이 작업을 사용하여 Grunt JavaScript 작업 실행기를 실행합니다.

Syntax

# Grunt v0
# Run the Grunt JavaScript task runner.
- task: Grunt@0
  inputs:
    gruntFile: 'gruntfile.js' # string. Required. Grunt File Path. Default: gruntfile.js.
    #targets: # string. Grunt Task(s). 
    #arguments: # string. Arguments. 
  # Advanced
    #workingDirectory: # string. Alias: cwd. Working Directory. 
    gruntCli: 'node_modules/grunt-cli/bin/grunt' # string. Required. grunt-cli location. Default: node_modules/grunt-cli/bin/grunt.
  # 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.
# Grunt v0
# The JavaScript Task Runner.
- task: Grunt@0
  inputs:
    gruntFile: 'gruntfile.js' # string. Required. Grunt File Path. Default: gruntfile.js.
    #targets: # string. Grunt Task(s). 
    #arguments: # string. Arguments. 
  # Advanced
    #workingDirectory: # string. Alias: cwd. Working Directory. 
    gruntCli: 'node_modules/grunt-cli/bin/grunt' # string. Required. grunt-cli location. Default: node_modules/grunt-cli/bin/grunt.
  # 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.

입력

gruntFile - Grunt 파일 경로
string. 필수 요소. 기본값은 gruntfile.js입니다.

리포지토리 루트에서 Grunt 스크립트로의 상대 경로를 지정합니다.


targets - Grunt 작업
string.

선택 사항입니다. 실행할 공백으로 구분된 작업 목록을 지정합니다. 지정하지 않으면 기본 작업이 실행됩니다.


arguments - 인수
string.

Grunt에 전달된 추가 인수를 지정합니다. 자세한 내용은 CLI 사용을 참조하세요.

참고:--gruntfile 는 위의 gruntFile 입력을 통해 이미 추가되었기 때문에 필요하지 않습니다.


workingDirectory - 작업 디렉터리
입력 별칭: cwd. string.

선택 사항입니다. 스크립트를 실행할 때 현재 작업 디렉터리를 지정합니다. 지정하지 않으면 작업 디렉터리가 기본적으로 스크립트가 있는 폴더로 설정됩니다.


gruntCli - grunt-cli 위치
string. 필수 요소. 기본값은 node_modules/grunt-cli/bin/grunt입니다.

에이전트가 전역적으로 설치된 grunt-cli를 찾을 수 없을 때 실행할 grunt-cli를 지정합니다. 기본값은 작업 디렉터리의 폴더 아래에 있는 node_modules grunt-cli입니다.


publishJUnitResults - Azure Pipelines에 게시
boolean. 기본값은 false입니다.

Grunt 빌드에서 생성된 JUnit 테스트 결과를 Azure Pipelines/TFS에 게시하려면 이 옵션을 선택합니다.


publishJUnitResults - Azure Pipelines/TFS에 게시
boolean. 기본값은 false입니다.

Grunt 빌드에서 생성된 JUnit 테스트 결과를 Azure Pipelines/TFS에 게시하려면 이 옵션을 선택합니다.


testResultsFiles - 테스트 결과 파일
string. 필요한 경우 publishJUnitResults = true입니다. 기본값은 **/TEST-*.xml입니다.

테스트 결과 파일 경로를 지정합니다. 와일드카드를 사용할 수 있습니다.

예를 들어 로 **/TEST-*.xml 시작하는 모든 XML 파일 이름에 대해 입니다 TEST-.


testRunTitle - 테스트 실행 제목
string. 선택 사항입니다. 을 사용할 때 publishJUnitResults = true사용합니다.

테스트 실행의 이름을 지정합니다.


enableCodeCoverage - 코드 검사 사용
boolean. 기본값은 false입니다.

이스탄불을 사용하여 코드 검사를 사용하도록 설정하려면 이 옵션을 선택합니다.


testFramework - 테스트 프레임워크
string. 선택 사항입니다. 을 사용할 때 enableCodeCoverage = true사용합니다. 허용되는 값: Mocha, Jasmine. 기본값은 Mocha입니다.

테스트 프레임워크를 지정합니다.


srcFiles - 원본 파일
string. 선택 사항입니다. 을 사용할 때 enableCodeCoverage = true사용합니다.

하려는 원본 파일의 경로를 지정합니다 hookRequire().


testFiles - 테스트 스크립트 파일
string. 필요한 경우 enableCodeCoverage = true입니다. 기본값은 test/*.js입니다.

테스트 스크립트 파일의 경로를 지정합니다.


작업 제어 옵션

모든 작업에는 작업 입력 외에 제어 옵션이 있습니다. 자세한 내용은 컨트롤 옵션 및 일반적인 작업 속성을 참조하세요.

출력 변수

없음

설명

JavaScript 작업 실행기를 사용하여 Grunt 작업을 실행하려면 이 작업을 사용합니다.

예제

샘플 Gruntfile을 참조하세요.

요구 사항

요구 사항 Description
파이프라인 유형 YAML, 클래식 빌드
실행 중 에이전트, DeploymentGroup
요청 자체 호스팅 에이전트에는 이 작업을 사용하는 작업을 실행하기 위한 다음 요구 사항과 일치하는 기능이 있어야 합니다. node.js
Capabilities 이 작업은 작업의 후속 작업에 대한 요구를 충족하지 않습니다.
명령 제한 사항 모두
설정 가능한 변수 모두
에이전트 버전 1.91.0 이상
작업 범주 빌드