The pipelines.yml
file is made up of resources, pipelines and steps, as shown below. For information about the Pipeline Example for Npm Builds, see Pipeline Example: Npm Build.
Resources
This example uses the following types of resources:
GitRepo
A GitRepo resource is used to connect JFrog Pipelines to a source control repository. Adding it creates a webhook to the repo so that future commits will automatically create a new version with the webhook payload.
resources
- name: npm_example_repo_jfp 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
Tag | Description | Required/Optional |
---|---|---|
name |
This name is used to refer to the resource in steps, and must be unique across all repositories in your JFrog Pipelines environment. | Required |
| The name of the GitHub Integration. Its value is retrieved from the values.yml file. | Required |
| The path of the repository from the integration root. Its value is retrieved from the values.yml file. | Required |
|
The | Optional |
BuildInfo
BuildInfo is automatically created when the NpmBuild step is used to generate packages. BuildInfo is then published to the configured Artifactory repo (sourceArtifactory: demoArt
) by providing that resource in the NpmPublish step.
resources
- name: npm_example_buildinfo_jfp type: BuildInfo configuration: sourceArtifactory: demoArt
Tag | Description | Required/Optional |
---|---|---|
name |
This name is used to refer to the resource in steps, and must be unique across all repositories in your JFrog Pipelines environment. | Required |
| The name of the Artifactory Integration. Its value is retrieved from the values.yml file. | Required |
Pipelines
npm_example_pipeline_jfp
is the name of the pipeline, which contains the steps for running the pipeline.
Steps
The npm_example_pipeline_jfp
pipeline contains the following native steps:
NpmBuild
NpmPublish
NpmBuild
The NpmBuild native step builds an npm source. This step automatically performs npm-install
on the source in a Git repository.
steps
- name: npm_build_step type: NpmBuild configuration: repositoryName: npm-virtual # required, npm repository name on artifacctory sourceLocation: ./npm-example # required, location of package.json file integrations: - name: demoArt # required inputResources: - name: npm_example_repo_jfp # required
Tag | Description of usage | Required/Optional |
---|---|---|
|
This is the name used when the step is assigned as an input to the next step, npm_publish_step. | Required |
|
| Required |
|
| Required |
| Specifies an Artifactory Integration where modules will be published. If a FileSpec resource is specified in | May be required |
| Must specify a GitRepo resource. The This step accepts | Required Optional |
NpmPublish
The NpmPublish step publishes an npm package to the registry in Artifactory following an NpmBuild step.
steps
- name: npm_publish_step type: NpmPublish configuration: # for payloadType npm: repositoryName: npm-virtual # required, npm repository name on artifactory autoPublishBuildInfo: true # optional integrations: - name: demoArt # required inputSteps: - name: npm_build_step # required outputResources: - name: npm_example_buildinfo_jfp # optional
Tag | Description of usage | Required/Optional |
---|---|---|
|
| Required |
|
| Required |
| When set to true, publishes build info to Artifactory. Default is false. Once published, the build info can be viewed in Artifactory, in the Build Browser under Builds. | Optional |
| Must specify an Artifactory Integration. | Required |
| Must specify a named NpmBuild or Bash step.
| Required |
| Must specify a BuildInfo resource if
| May be required |