1. Install the JFrog extension to set up the Azure pipeline for integration with Artifactory.
2. Configure the service connection inside the project settings by adding the JFrog details.
3. Click on verify and should be successful.
4. You can initiate the pipeline setup by navigating to "Pipelines" and choosing the location where your code is stored. Then, select the repository you intend to work on.
5. Select the starter pipeline option.
6. Now add the NPM task by selecting JFrog NPM and add all the details. You may also create your custom task by selecting the custom under the JFrog npm task.
Below screenshot for the reference:
Pipelines.yaml
pool: vmImage: 'ubuntu-20.04' steps: - task: JFrogNpm@1 inputs: command: 'pack and publish' artifactoryConnection: 'shivani' targetRepo: 'shivani-npm-local' workingFolder: 'npm3/' collectBuildInfo: true buildName: '$(Build.DefinitionName)' buildNumber: '$(Build.BuildNumber)' - task: JFrogPublishBuildInfo@1 inputs: artifactoryConnection: 'shivani' buildName: '$(Build.DefinitionName)' buildNumber: '$(Build.BuildNumber)' - task: JFrogBuildPromotion@1 inputs: artifactoryConnection: 'shivani' buildName: '$(Build.DefinitionName)' buildNumber: '$(Build.BuildNumber)' targetRepo: 'shivani-promotion-local' status: 'Released' comment: 'Released' sourceRepo: 'shivani-npm-local' includeDependencies: false copy: true dryRun: false
7. Click on save and run.
8. Once the build is successful you could navigate to the Artifactory UI to confirm if the packages have been published and promoted to the repository.