Partager via


Quickstart - Use Azure Pipelines to build and publish a Node.js package

TFS 2018

You can use an Azure DevOps pipeline to build, deploy, and test JavaScript apps.

This quickstart walks through how to use a pipeline to create a Node.js package with Node Package Manager (npm) and publish a pipeline artifact.

  1. Fork the following repo at GitHub.

    https://github.com/Azure-Samples/js-e2e-express-server
    
  2. After you have the sample code in your own repository, create your first pipeline and select the Empty process template.

  3. Select Process under the Tasks tab in the pipeline editor and change the properties as follows:

    • Agent queue: Hosted Ubuntu Latest
  4. Add the following tasks to the pipeline in the specified order:

    • npm

      • Command: install
    • npm

      • Display name: npm test
      • Command: custom
      • Command and arguments: test
    • Publish Test Results

      • Leave all the default values for properties
    • Archive Files

      • Root folder or file to archive: $(System.DefaultWorkingDirectory)
      • Prepend root folder name to archive paths: Unchecked
    • Publish Build Artifacts

      • Leave all the default values for properties
  5. Save the pipeline and queue a build to see it in action.

Next steps

Congratulations, you've successfully completed this quickstart!