Administering Pipeline Sources
Only users with administrator privileges can manage pipeline sources.
Requirements
To successfully add a pipeline source, ensure the following:
- The credentials used in the source control integration should have admin access to the specified source control repository. Admin privileges are used to add a webhook that allows Pipelines to be notified of changes in the repository.
- Pipelines 1.26.0 and lower: The repository path is valid. To know the exact path to specify, inspect the git clone URL of that repository in your source control system and copy the value.
Here are some examples:- GitHub / GitHub Enterprise: https://github.com/myuser/basic-pipeline.git - use myuser/basic-pipeline
- Bitbucket Server (Private repository): https://git.mycompany.com/scm/project-id/repo-name.git - use project-id/repo-name
- Bitbucket Server (Individual repository): https://git.mycompany.com/scm/~myuser/myfirstrepo.git - use ~myuser/myfirstrepo
- Bitbucket: https://username@bitbucket.org/teamspace/test-repo.git - use teamspace/test-repo
- GitLab: https://gitlab.com/user1/repo1.git - use user1/repo1
- Branch name is valid and the credential used in the Git integration for the pipeline source has access to the branch.
Add an integration for the source control system where your pipeline file repository is (or will be) located. The integration can be one of these source control system providers:
Adding a Pipeline Source (1.31.0 and higher)
To add a source control repository as a Pipeline Source:
- Go to Administration | Pipelines | Pipeline Sources.
- In the resulting Pipeline Sources display, click Add Pipeline Source. and click From YAML.
- In the Add YAML Pipeline Source page, click one of the following:
- Single Branch
- Multi Branch
- Click to select the protocol type to be used for cloning the repository when the pipeline source is synced:
- SSH
- HTTPS
Complete the Single/Multi Branch form:
Field Description Name
Enter a unique name for the pipeline source. SCM Provider Integration
Click the SCM Provider Integration field and select your source control integration from the dropdown list. Only integrations that are compatible for use as a Pipeline Source will be included in the dropdown list. Repository Full Name
Based on the information you have provided for the selected integration, such as API token, all the relevant repositories are listed in the Repository Full Name field. Select the path of the repository where your pipeline files are stored. If the name of the repository is not auto-fetched, enter the full name of the repository where your pipeline files are stored.
Branch (Single Branch only)
Based on the SCM provider and Repository Full Name you have provided, a ll the available branches are automatically fetched (for example,
main
). Select the required branch. If the name of the branch is not auto-fetched, enter the name of the branch.Exclude (Multi Branch only)
Specify the Exclude Branch Pattern as a regular expression for the matching branch names to exclude.
Include (Multi Branch only)
Specify the Include Branch Pattern as a regular expression for the matching branch names to include.
Sync all branches toggle
(Multi Branch only)
When a new multi branch pipeline source is added, only the default branched is synced. To sync all the branches based on the Exclude/Include pattern, click the Sync all branches toggle. If Exclude/Include pattern is not provided, all branches are synced.
In addition, when a new commit is pushed to the matching branch, that particular branch is synced.
Folder Name Provide the name of the directory where the YAML config is available.
- To use Folder Name, in the SCM repository, place your YAML files in a directory named .
jfrog-pipelines
. This directory can be the root or one level below the root. Directories beyond this level are not supported. - Following are the possible directory structures for monorepos:
- root
------ .jfrog-pipelines
Or- root
---- .jfrog-pipelines
-------- service1
-------- service2
Or- root
---- service1
--------- .jfrog-pipelines
---- service2
--------- .jfrog-pipelines
- The .
jfrog-pipelines
directory can contain any number of YAML files. - To parse all YAML files in the root directory, enter ".". However, other pipeline sources cannot point to this repository.
- You can create multiple pipeline sources pointing to the same SCM repository as long as the directory names are different (and none of them point to root).
Recommended Directory Structure for using Folder Name
Here are some examples of the supported directory structure:
YAML Files Location Folder Name Path YAML files are in the .jfrog-pipelines
root directoryEnter
.
(dot) or.jfrog-pipelines
in the Folder Name field to fetch all the YAML filesYAML files are in the .jfrog-pipelines/project1
directoryEnter
.jfrog-pipelines/project1
in the Folder Name field to fetch the YAML files in the.jfrog-pipelines/project1
directoryYAML files are in the following directories:
- .jfrog-pipelines
- .jfrog-pipelines/project1
- .jfrog-pipelines/project2
Enter
.
(dot) or.jfrog-pipelines
in the Folder Name field to fetch all the YAML files in all directoriesor
Enter
.jfrog-pipelines/project1
in the Folder Name field to fetch the YAML files in the.jfrog-pipelines/project1
directoryEnter
.jfrog-pipelines/project2
in the Folder Name field to fetch the YAML files in the.jfrog-pipelines/project2
directoryYAML files are in the following directories:
- .jfrog-pipelines
service1
/.jfrog-pipelinesservice2
/.jfrog-pipelines
Enter
.
(dot) or.jfrog-pipelines
in the Folder Name field to fetch the YAML files in the.jfrog-pipelines
directory, but YAML files in theservice1
/.jfrog-pipelines
andservice2
/.jfrog-pipelines
directories will not be included.or
Enter
service1
/.jfrog-pipelines
in the Folder Name field to fetch specific YAML files in theservice1
/.jfrog-pipelines
directoryEnter
service2
/.jfrog-pipelines
in the Folder Name field to fetch specific YAML files in theservice2
/.jfrog-pipelines
directoryIf you have a monorepo with multiple services within a single repo, a directory structure such as the following is recommended:
Existing Directory Structure Recommended Directory Structure Root
Build/ci- Service1
- Build/ci/pipe.yaml
- Service2
- Build/ci/pipe.yaml
Root
.jfrog-pipelines- Service1/pipe.yaml
- Service2/pipe.yaml
- To use Folder Name, in the SCM repository, place your YAML files in a directory named .
Adding a Pipeline Source (1.30.0 and lower)
To add a source control repository as a Pipeline Source:
- Go to Administration | Pipelines | Pipeline Sources.
- In the resulting Pipeline Sources display, click Add Pipeline Source and click one of the following:
- From YAML: Add the pipeline source from a YAML configuration file, which contains the declarations of all resources and workflow steps.
- From Template: Add the pipeline source from a pre-defined template by providing a values file. For more information, see Pipelines Templates.
From YAML
- In the Add YAML Pipeline Source page, click one of the following:
- Single Branch
- Multi Branch
- Click to select the protocol type to be used for cloning the repository when the pipeline source is synced:
- SSH
- HTTPS
Complete the Single/Multi Branch form:
Field Description Name
Enter a unique name for the pipeline source. SCM Provider Integration
Click the SCM Provider Integration field and select your source control integration from the dropdown list. Only integrations that are compatible for use as a Pipeline Source will be included in the dropdown list. Repository Full Name
Based on the information you have provided for the selected integration, such as API token, all the relevant repositories are listed in the Repository Full Name field. Select the path of the repository where your pipeline files are stored. If the name of the repository is not auto-fetched, enter the full name of the repository where your pipeline files are stored.
Branch (Single Branch only)
Based on the SCM provider and Repository Full Name you have provided, a ll the available branches are automatically fetched (for example,
main
). Select the required branch. If the name of the branch is not auto-fetched, enter the name of the branch.Exclude (Multi Branch only)
Specify the Exclude Branch Pattern as a regular expression for the matching branch names to exclude.
Include (Multi Branch only)
Specify the Include Branch Pattern as a regular expression for the matching branch names to include.
Sync all branches toggle
(Multi Branch only)
When a new multi branch pipeline source is added, only the default branched is synced. To sync all the branches based on the Exclude/Include pattern, click the Sync all branches toggle. If Exclude/Include pattern is not provided, all branches are synced.
In addition, when a new commit is pushed to the matching branch, that particular branch is synced.
Folder Name (Pipelines 1.27.0 and higher) Provide the name of the directory where the YAML config is available.
- To use Folder Name, in the SCM repository, place your YAML files in a directory named .
jfrog-pipelines
. This directory can be the root or one level below the root. Directories beyond this level are not supported. - Following are the possible directory structures for monorepos:
- root
------ .jfrog-pipelines
Or- root
---- .jfrog-pipelines
-------- service1
-------- service2
Or- root
---- service1
--------- .jfrog-pipelines
---- service2
--------- .jfrog-pipelines
- The .
jfrog-pipelines
directory can contain any number of YAML files. - To parse all YAML files in the root directory, enter ".". However, other pipeline sources cannot point to this repository.
- You can create multiple pipeline sources pointing to the same SCM repository as long as the directory names are different (and none of them point to root).
Recommended Directory Structure for using Folder Name
Here are some examples of the supported directory structure:
YAML Files Location Folder Name Path YAML files are in the .jfrog-pipelines
root directoryEnter
.
(dot) or.jfrog-pipelines
in the Folder Name field to fetch all the YAML filesYAML files are in the .jfrog-pipelines/project1
directoryEnter
.jfrog-pipelines/project1
in the Folder Name field to fetch the YAML files in the.jfrog-pipelines/project1
directoryYAML files are in the following directories:
- .jfrog-pipelines
- .jfrog-pipelines/project1
- .jfrog-pipelines/project2
Enter
.
(dot) or.jfrog-pipelines
in the Folder Name field to fetch all the YAML files in all directoriesor
Enter
.jfrog-pipelines/project1
in the Folder Name field to fetch the YAML files in the.jfrog-pipelines/project1
directoryEnter
.jfrog-pipelines/project2
in the Folder Name field to fetch the YAML files in the.jfrog-pipelines/project2
directoryYAML files are in the following directories:
- .jfrog-pipelines
service1
/.jfrog-pipelinesservice2
/.jfrog-pipelines
Enter
.
(dot) or.jfrog-pipelines
in the Folder Name field to fetch the YAML files in the.jfrog-pipelines
directory, but YAML files in theservice1
/.jfrog-pipelines
andservice2
/.jfrog-pipelines
directories will not be included.or
Enter
service1
/.jfrog-pipelines
in the Folder Name field to fetch specific YAML files in theservice1
/.jfrog-pipelines
directoryEnter
service2
/.jfrog-pipelines
in the Folder Name field to fetch specific YAML files in theservice2
/.jfrog-pipelines
directoryIf you have a monorepo with multiple services within a single repo, a directory structure such as the following is recommended:
Existing Directory Structure Recommended Directory Structure Root
Build/ci- Service1
- Build/ci/pipe.yaml
- Service2
- Build/ci/pipe.yaml
Root
.jfrog-pipelines- Service1/pipe.yaml
- Service2/pipe.yaml
Migrating from Config File Filter to the New Folder Structure
In Pipelines version 1.27.0, Config File Filter has been replaced with a new field called Folder Name for adding your pipeline sources. Though Config File Filter is still supported and available while editing a pipeline source.
- This change does not affect pipeline sources added before 1.26.0. However, it is highly recommended that you use the recommended folder structure for new pipeline sources and move your existing sources to the recommended folder structure. Using the folder structure significantly improves the performance of your pipeline sync.
- You can take advantage of the Folder Name feature by editing the pipeline source and then providing the new directory path. In this case, the entry in the Config File Filter is ignored and the pipeline source in the directory path is used.
- If both the fields have values, then the Folder Name field takes precedence. However, if no
.jfrog-pipelines
directory is found in the directory path, then information in the Config File Filter field is used to find the YAML files.
Config File Filter (Pipelines 1.26.0 and lower) Enter a regular expression. Any filenames that match the expression will be loaded.
Examples:- If you plan to declare your resources in a file named
pipelines.resources.yml
and your pipelines inpipelines.workflows.yml
, then you might enterpipelines.*.yml
. If you have multiple yaml config files, then enter
.*yml
.- In addition to the
pipelines.yml
, if you are using avalues.yml
, ensure both files are added to the filter, using(pipelines|values).yml
.
- If you plan to declare your resources in a file named
- To use Folder Name, in the SCM repository, place your YAML files in a directory named .
From Template
- Complete the Template Properties form:
- Click the Select Template Namespace field and select the namespace.
- Click the Select Template Names field and select the template.
Click the Select Template Version field and select the version for the template.
- Click Next.
In the resulting Specify values file page, click one of the following from the Read YAML values from drop-down:- Source Control Repository: Use this when you want to fetch the values.yml file from an SCM provider.
- Enter Manually: Use this when you want to manually the define the values for the pipeline source.
- Source Control Repository
Click one of the following:- Single Branch
- Multi Branch
- Click to select the protocol type to be used for cloning the repository when the pipeline source is synced:
- SSH
- HTTPS
Complete the Single/Multi Branch form:
Field Description Name
Enter a unique name for the pipeline source. SCM Provider Integration
Click the SCM Provider Integration field and select your source control integration from the dropdown list. Only integrations that are compatible for use as a Pipeline Source will be included in the dropdown list. Repository Full Name
Based on the information you have provided for the selected integration, such as API token, all the relevant repositories are listed in the Repository Full Name field. Select the path of the repository where your pipeline files are stored. If the name of the repository is not auto-fetched, enter the full name of the repository where your pipeline files are stored.
Branch (Single Branch only)
B ased on the SCM provider and Repository Full Name you have provided, a ll the available branches are automatically fetched (for example,
main
). Select the required branch. If the name of the branch is not auto-fetched, enter the name of the branch.Exclude (Multi Branch only)
Specify the Exclude Branch Pattern as a regular expression for the matching branch names to exclude.
Include (Multi Branch only)
Specify the Include Branch Pattern as a regular expression for the matching branch names to include.
Sync all branches toggle
(Multi Branch only)
When a new multi branch pipeline source is added, only the default branched is synced. To sync all the branches based on the Exclude/Include pattern, click the Sync all branches toggle. If Exclude/Include pattern is not provided, all branches are synced.
In addition, when a new commit is pushed to the matching branch, that particular branch is synced.
Values File Path Enter the path to the .values.yml
file, which contains the values for the template.- Enter Manually
- Name: Enter a unique name to identify a pipeline source definition created from the template.
- Values.yml: Manually enter or paste the Values definition.
- Click Create Source to complete adding the Pipeline Source.
If JFrog Pipelines successfully syncs with the repository, the Status field displays "Success". Otherwise, it displays "Failed".
All pipeline config files committed to the repository will be automatically loaded into JFrog Pipelines, and all defined pipelines from that source are listed in the pipeline list.
Validating YAML
Before adding a pipeline source, you have the option of validating your pipelines, resources, and values YAMLs and then committing it to the SCM. This enables you to get instant feedback on pipeline sync errors. The YAML validator will validate your YAML for both semantic and syntactic errors.
To validate your YAML:
- Click Validate YAML.
- Either enter the YAML and paste the YAML contents in the Pipelines YAML and Resources YAML fields. If you have a values YAML, enter the YAML contents in the Values YAML field. For more information about the Pipelines DSL, see Defining a Pipeline.
As the YAML content is entered, it is validated and syntactic errors, if any, are displayed. - After fixing all the syntactic errors, click Validate to validate the YAML for semantic errors.
Viewing Pipeline Sources
To view the list of pipeline sources already added to Pipelines, go to Administration | Pipelines | Pipeline Sources or Application | Pipelines | Pipeline Sources.
The page displays the list of pipelines sources that are available to you according to the permission targets defined in the JFrog Platform. Your user account must be granted permissions for a pipeline source for it to be shown.
Each row of the pipeline sources list includes the following:
Name |
|
Git Repository | The source repository path of the pipeline source |
Project | The Project that the pipeline source belongs to |
Latest Status | The success/failure status of the last sync |
Config File Filter | The filter string for the pipeline config files |
Last Sync | The time and date of the last sync |
Changed By | Name of the user who made the last update to the pipeline source |
Context | The commit SHA that triggered the last sync |
Logs | Click the Logs link to view the log from the last sync. Use this to diagnose a failure to sync a pipeline source. |
If the pipeline source is a multi branch source, the row presents aggregate information for all branches, and can be expanded/collapsed to show the sync status of each branch.
Syncing a Pipeline Source
When any of the pipeline config files have changed, you will need to sync the pipeline source to reload:
- Go to Administration | Pipelines | Pipeline Sources and click the Actions button located at the far right.
- Click Sync.
Viewing Sync Logs
To view the logs of all synchronized config files:
- Go to Administration | Pipelines | Pipeline Sources and click the Actions button located at the far right.
- Click Logs.
Pipeline Source Sync Recovery
Pipelines provides an option to enable auto-sync for pipelines sources that are out of sync. For more information, see Pipeline Source Sync Recovery.
Deleing a Pipeline Source
When a pipeline source is deleted, it deletes all the pipelines associated with the source.
To delete a pipeline source:
- Go to Administration | Pipelines | Pipeline Sources and click the Actions button located at the far right.
- Click Delete.
- Click Confirm on the confirmation window that appears.
A pipeline source cannot be deleted if any of its associated pipeline is still running. You can either cancel the run or wait for the run to complete and then delete the pipeline source.
Fetching Branches
When one or more branches are created for a Multibranch pipeline source, the webhooks may not be processed correctly, resulting in those branches not being added to the pipeline source.
Pipelines can automatically fetch and sync missing branches in a multibranch pipeline source based on the selected SCM integration and the full name of the repository.
To do this:
- Click the Actions button for the multibranch pipeline, and then click Fetch Branches.
The Fetch Branches window appears. - In the Branch field, you can either:
- Enter the name of the branch you want to fetch and sync.
or - Click the Fetch Branches button to try to automatically fetch all the branches based on the configured SCM integration and repository.
If one or more branches are found, they are listed in the drop-down menu.
- Enter the name of the branch you want to fetch and sync.
- Click to select the relevant branches.
- Click Confirm to sync the pipeline source.
The newly found branches are now listed on the Pipeline Sources page.