Jenkins GitHub Repository Item Configuration: Difference between revisions
(Created page with "=Internal= * Jenkins Concepts") |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=External= | |||
* https://wiki.jenkins.io/display/JENKINS/GitHub+Branch+Source+Plugin | |||
=Internal= | =Internal= | ||
* [[Jenkins Concepts#GitHub_Repository|Jenkins Concepts]] | |||
* [[ | =General= | ||
==Name== | |||
Also known as "Folder Name" | |||
==Display Name== | |||
Different from the item name. | |||
=Branch Sources= | |||
==GitHub== | |||
===Credentials=== | |||
Credentials used to scan branches and pull requests, check out sources and mark commit statuses. For GitHub, only "username with password" credentials are supported, credentials of other kinds will be filtered out. This is because Jenkins uses GitHub API, which does not support other ways of authentication. If none is given, only the public repositories will be scanned, and commit status will not be set on GitHub. If your organization contains private repositories, then you need to specify a credential from a user that has access to those repositories. This is done by creating a "username with password" credential where the password is GitHub personal access tokens. The necessary scope is "repo". | |||
===Owner=== | |||
GitHub user account or GitHub organization. | |||
===Repository=== | |||
The GitHub repository to scan. | |||
===Behaviors=== | |||
====Discover branches==== | |||
Strategies to discover branches: | |||
* "All branches" | |||
* "Exclude branches that are also filed as PRs" | |||
* "Only branches that are also filed as PRs" | |||
====Discover pull request from origin==== | |||
Strategies: | |||
* "The current pull request revision" | |||
====Discover pull request from forks==== | |||
Strategies: | |||
* Merging the pull request with the current target branch version | |||
Trust: | |||
* Nobody | |||
====Filter by name (with regular expression)==== | |||
A Java regular expression to restrict branch names. Names that do not match the regex will be ignored. | |||
(task|epic)\/.*\/infra\/.* | |||
====Advanced clone behaviors==== | |||
* Fetch tags: Disable. | |||
* Honor refspec on initial clone: Enable. Perform initial clone using the refspec defined for the repository. This can save time, data transfer and disk space when you only need to access the references specified by the refspec. | |||
* Shallow clone: Enable. Perform shallow clone, so that git will not download the history of the project, saving time and disk space when you just want to access the latest version of a repository. | |||
* Shallow clone depth: 20 | |||
* Path of the reference repo to use during clone: | |||
* Timeout (in minutes) for clone and fetch operations: 20 | |||
====Prune stale remote-tracking branches==== | |||
===Property Strategy=== | |||
Named branches get different [[Jenkins_Concepts#Properties|properties]]. | |||
=Build Configuration= | |||
==Mode== | |||
By Jenkinsfile. | |||
Script path: src/something/Something.Jenkinsfile | |||
=Scan Repository Triggers= | |||
* Build when another project is promoted. | |||
* Periodically if not otherwise run | |||
** Interval: 15 minutes | |||
=Orphaned Item Strategy= | |||
Discard old items | |||
=Health metrics= | |||
=Properties= | |||
=JIRA= | |||
=Pipeline Libraries= | |||
Sharable libraries available to any Pipeline jobs inside this folder. These libraries will be untrusted, meaning their code runs in the Groovy sandbox. | |||
<font color=darkgray>TODO</font> | |||
=Pipeline Model Definition= |
Latest revision as of 00:22, 1 January 2020
External
Internal
General
Name
Also known as "Folder Name"
Display Name
Different from the item name.
Branch Sources
GitHub
Credentials
Credentials used to scan branches and pull requests, check out sources and mark commit statuses. For GitHub, only "username with password" credentials are supported, credentials of other kinds will be filtered out. This is because Jenkins uses GitHub API, which does not support other ways of authentication. If none is given, only the public repositories will be scanned, and commit status will not be set on GitHub. If your organization contains private repositories, then you need to specify a credential from a user that has access to those repositories. This is done by creating a "username with password" credential where the password is GitHub personal access tokens. The necessary scope is "repo".
Owner
GitHub user account or GitHub organization.
Repository
The GitHub repository to scan.
Behaviors
Discover branches
Strategies to discover branches:
- "All branches"
- "Exclude branches that are also filed as PRs"
- "Only branches that are also filed as PRs"
Discover pull request from origin
Strategies:
- "The current pull request revision"
Discover pull request from forks
Strategies:
- Merging the pull request with the current target branch version
Trust:
- Nobody
Filter by name (with regular expression)
A Java regular expression to restrict branch names. Names that do not match the regex will be ignored.
(task|epic)\/.*\/infra\/.*
Advanced clone behaviors
- Fetch tags: Disable.
- Honor refspec on initial clone: Enable. Perform initial clone using the refspec defined for the repository. This can save time, data transfer and disk space when you only need to access the references specified by the refspec.
- Shallow clone: Enable. Perform shallow clone, so that git will not download the history of the project, saving time and disk space when you just want to access the latest version of a repository.
- Shallow clone depth: 20
- Path of the reference repo to use during clone:
- Timeout (in minutes) for clone and fetch operations: 20
Prune stale remote-tracking branches
Property Strategy
Named branches get different properties.
Build Configuration
Mode
By Jenkinsfile.
Script path: src/something/Something.Jenkinsfile
Scan Repository Triggers
- Build when another project is promoted.
- Periodically if not otherwise run
- Interval: 15 minutes
Orphaned Item Strategy
Discard old items
Health metrics
Properties
JIRA
Pipeline Libraries
Sharable libraries available to any Pipeline jobs inside this folder. These libraries will be untrusted, meaning their code runs in the Groovy sandbox.
TODO