Događaj
Izgradite AI aplikacije i agente
17. mar 21 - 21. mar 10
Pridružite se seriji sastanaka kako biste izgradili skalabilna AI rešenja zasnovana na stvarnim slučajevima korišćenja sa kolegama programerima i stručnjacima.
Registrujte se odmahOvaj pregledač više nije podržan.
Nadogradite na Microsoft Edge biste iskoristili najnovije funkcije, bezbednosne ispravke i tehničku podršku.
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
In this quickstart, you use a pipeline to create a Node.js package with Node Package Manager (npm) and publish a pipeline artifact. You learn how to use Azure Pipelines to build, deploy, and test your JavaScript apps.
Fork the sample Express.js server app.
Važno
During the following procedures, you might be prompted to create a GitHub service connection or redirected to GitHub to sign in, install Azure Pipelines, or authorize Azure Pipelines. Follow the onscreen instructions to complete the process. For more information, see Access to GitHub repositories.
Edit your azure-pipelines.yml file as follows.
Replace the contents of the file with the following code. The code updates the Node.js tool installer task to use Node.js version 16 LTS.
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseNode@1
inputs:
version: '16.x'
displayName: 'Install Node.js'
- script: |
npm install
displayName: 'npm install'
- script: |
npm run build
displayName: 'npm build'
- script:
npm test
displayname: 'npm test'
Add the following new tasks to the pipeline:
The copy files task copies the files from the src and public folders to the build artifact staging directory.
The publish pipeline artifact task gets the files from the artifact staging location and publishes them as artifacts to be output with pipeline builds.
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
contents: |
src/*
public/*
targetFolder: '$(Build.ArtifactStagingDirectory)'
displayName: 'Copy project files'
- task: PublishPipelineArtifact@1
inputs:
artifactName: e2e-server
targetPath: '$(Build.ArtifactStagingDirectory)'
publishLocation: 'pipeline'
displayName: 'Publish npm artifact'
Select Validate and save, then select Save, select Run, and select Run again.
After your pipeline runs, verify that the job ran successfully and that you see a published artifact.
Congratulations, you successfully created and ran a pipeline that built and tested a Node.js package. You can build, test, and deploy Node.js apps as part of your Azure Pipelines continuous integration and continuous delivery (CI/CD) system.
Događaj
Izgradite AI aplikacije i agente
17. mar 21 - 21. mar 10
Pridružite se seriji sastanaka kako biste izgradili skalabilna AI rešenja zasnovana na stvarnim slučajevima korišćenja sa kolegama programerima i stručnjacima.
Registrujte se odmahObuka
Modul
Manage build dependencies with Azure Artifacts - Training
In this module, the Space Game web team guides you through creating a build pipeline that produces a package that can be used by multiple applications.
Certifikacija
Microsoft Certified: Azure Developer Associate - Certifications
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.
Dokumentacija
Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Azure Artifacts.
NodeTool@0 - Node.js tool installer v0 task
Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH.
Tutorial: Automate Node.js deployments with Azure Pipelines - Azure Pipelines
Tutorial that shows how to create an Azure Pipeline that builds and deploys a basic Node.js application to Azure App Service.