NpmBuild - Examples

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

The following examples show how to configure an NpmBuild step. For more information about NpmBuild Pipeline steps, see NpmBuild.

Using Default Settings

An NpmBuild step using default locations and default commands.

NpmBuild

# This config file is templatized so that it can be easily customized. Values can be provided with a values.yml file.
template: true   # required for local templates
valuesFilePath: ./values.yml

resources:
  - name: npm_repo_jfp_example
    type: GitRepo
    configuration:
      # SCM integration where the repository is located
      gitProvider: {{ .Values.myRepo.gitProvider }}
      # Repository path, including org name/repo name
      path: {{ .Values.myRepo.path }}
      branches:
        # Specifies which branches will trigger dependent steps
        include: master

  - name: npm_buildinfo_jfp_example
    type: BuildInfo
    configuration:
      sourceArtifactory: demoArt

pipelines:
  - name: npm_pipeline_jfp_example
    steps:
      - name: npm_build_step
        type: NpmBuild
        configuration:
          repositoryName: npm-virtual      # required, npm repository name on artifacctory
          sourceLocation: .      # required, location of package.json file
          integrations:
            - name:  demoArt  # required
          inputResources:
            - name: npm_repo_jfp_example         # required

Using FileSpec Input

An NpmBuild step with a FileSpec input providing files for the build that are not in the GitRepo and resolverRepo specifying an Artifactory repository to use when resolving dependencies.

NpmBuild

pipelines: 
  - name: npmBuildPipeline
    steps:
      - name: npmBuildStep
        type: NpmBuild
        configuration: 
          sourceLocation: "source"
          resolverRepo: remote-npm
          inputResources:
            - name: gitRepoResource
            - name: fileSpecResource
          integrations:
            - name: artifactory_integration