content large_stringlengths 3 20.5k | url large_stringlengths 54 193 | branch large_stringclasses 4 values | source large_stringclasses 42 values | embeddings listlengths 384 384 | score float64 -0.21 0.65 |
|---|---|---|---|---|---|
.xref:index.adoc[] \* xref:backing-up.adoc[] \* xref:monitoring.adoc[] \* xref:administering-jenkins-on-kubernetes.adoc[] \* xref:with-chef.adoc[] \* xref:with-puppet.adoc[] \* xref:viewing-logs.adoc[] \* xref:authenticating-scripted-clients.adoc[] \* xref:reverse-proxy-configuration-with-jenkins/index.adoc[] \*\* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-apache.adoc[] \*\* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-nginx.adoc[] \*\* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-haproxy.adoc[] \*\* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-squid.adoc[] \*\* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iis.adoc[] \*\* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iptables.adoc[] \* xref:user-docs:system-administration:reverse-proxy-configuration-troubleshooting.adoc[] \* xref:systemd-services.adoc[] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/nav.adoc | main | jenkins | [
-0.07314814627170563,
-0.02027370221912861,
-0.05918439105153084,
-0.018183499574661255,
-0.0015447025652974844,
-0.05167074501514435,
-0.004473747685551643,
-0.05444849655032158,
-0.021771425381302834,
0.005321292672306299,
0.026762263849377632,
-0.04431801289319992,
-0.07674212753772736,
... | 0.086576 |
= Reverse proxy configuration [pass] ++++ (function () { var anchorMap = { "ji-toolbar" : "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/", /\* Algolia search redirect to stay on same page \*/ "running-jenkins-behind-apache": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-apache/", "running-jenkins-behind-haproxy": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-haproxy/", "running-jenkins-behind-iis": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iis/", "running-jenkins-behind-iptables": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iptables/", "running-jenkins-behind-nginx": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-nginx/", "running-jenkins-behind-squid": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-squid/", "troubleshooting": "/doc/book/system-administration/reverse-proxy-configuration-troubleshooting/", "jenkins-says-my-reverse-proxy-setup-is-broken": "/doc/book/system-administration/reverse-proxy-configuration-troubleshooting/", } /\* \* Best practice for extracting hashes: \* https://stackoverflow.com/a/10076097/151365 \*/ var hash = window.location.hash.substring(1); if (hash) { /\* \* Best practice for javascript redirects: \* https://stackoverflow.com/a/506004/151365 \*/ window.location.replace(anchorMap[hash]); } })(); ++++ A 'link:https://en.wikipedia.org/wiki/Reverse\_proxy[reverse proxy]' allows an alternate HTTP or HTTPS provider to communicate with web browsers on behalf of Jenkins. The alternate provider may offer additional capabilities, like SSL encryption. The alternate provider may offload some work from Jenkins, like delivering static images. == General Guidelines Jenkins actively monitors reverse proxy configuration. Jenkins reports xref:system-administration:reverse-proxy-configuration.adoc["`+Your reverse proxy setup is broken+`"] when it detects a reverse proxy configuration problem. Refer to the xref:system-administration:reverse-proxy-configuration.adoc[troubleshooting] section if Jenkins is reporting that your reverse proxy setup is broken. === Background Reverse proxies receive inbound HTTP requests and forward those requests to Jenkins. It receives the outbound HTTP response from Jenkins and forwards those requests to the original requester. A correctly configured reverse proxy rewrites \*both\* the HTTP request and the HTTP response. When HTTP request rewriting is misconfigured, pages won't be displayed at all. Refer to \*link:#configuration-examples[Configuration Examples by Server Type]\* if your reverse proxy is not displaying any Jenkins pages. A reverse proxy must handle the HTTP response by either rewriting the response or setting HTTP headers on the forwarded request. When HTTP response handling is misconfigured, Jenkins may fail to show updated information on a page or it may ignore changes submitted through web pages. Refer to the xref:system-administration:reverse-proxy-configuration.adoc[troubleshooting] section if Jenkins is reporting that your reverse proxy setup is broken or pages are not behaving as expected. [#configuration-examples] == Configuration Examples by Server Type Jenkins works with many different reverse proxies. This section provides examples for specific reverse proxies, though much of the information also applies to other reverse proxies. \* xref:system-administration:reverse-proxy-configuration-apache.adoc[Running Jenkins with Apache] \* xref:system-administration:reverse-proxy-configuration-nginx.adoc[Running Jenkins with Nginx] \* xref:system-administration:reverse-proxy-configuration-haproxy.adoc[Running Jenkins with HAProxy] \* xref:system-administration:reverse-proxy-configuration-squid.adoc[Running Jenkins with Squid] \* xref:system-administration:reverse-proxy-configuration-iis.adoc[Running Jenkins with IIS] \* xref:system-administration:reverse-proxy-configuration-iptables.adoc[Running Jenkins with iptables] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration.adoc | main | jenkins | [
-0.03767923638224602,
0.05256505683064461,
-0.015871582552790642,
0.037282440811395645,
-0.039667773991823196,
-0.06828249245882034,
-0.031507790088653564,
-0.03969026729464531,
-0.0309393722563982,
0.0027743421960622072,
-0.03287654370069504,
0.008414491079747677,
0.00990153569728136,
-0.... | 0.033847 |
ifdef::backend-html5[] :notitle: :description: :author: :email: jenkinsci-users@googlegroups.com :sectanchors: :toc: left endif::[] = Reset the Jenkins administrator password As a system administrator, you can reset the Jenkins admin password. In case you have forgotten or lost the password, this page provides instructions on how you can reset the admin password. video::\_VhOMyWDIcY[youtube, width=640, height=360] == Reset the administrator password 1. Log in to your Jenkins controller. 2. Stop the Jenkins process. You may use this command: `systemctl stop jenkins`. 3. Edit the Jenkins configuration file (`config.xml`) inside your `jenkins/` or `$JENKINS\_HOME` directory. 4. Look for \*\*useSecurity\*\* and change it from \*true\* to \*false\* manually. 5. Save your file and close it. 6. Restart the Jenkins service to apply your changes. You may use this command: `systemctl start jenkins`. After restarting Jenkins, navigate to your controller and sign in. 7. On the dashboard, select \*Manage Jenkins\* in the navigation pane on the left side of the page. 8. On the \*Manage Jenkins\* page, under the \*Security\* section, select \*Configure Global Security\*. 9. Under \*Security Realm\*, select \*Jenkins' own user database\* from the dropdown menu. Ensure the option \*Allow users to sign up\* is unchecked and save your changes. This redirects you to the Manage Jenkins page. 10. On the \*\*Manage Jenkins\*\* page, select \*\*Users\*\*. 11. You will see a list showing User IDs. Select the User ID that you want to change the password for. 12. Select Configure using the gear icon or the dropdown menu from the User ID. Locate the \*Password\* section to change your password. After changing the password, you will be able to log into your Jenkins controller again using the same username and the new password that you have just set. NOTE: Please ensure not to leave the Jenkins controller insecure. So, please re-enable the security by following these steps. == Enable security 1. Log in as your admin account. 2. On the dashboard, select \*Manage Jenkins\* in the navigation pane on the left side of the page. 3. On the \*Manage Jenkins\* page, under the \*Security\* section, select \*Configure Global Security\*. 4. Set the \*Authorization\* to \*Logged-in users can do anything\*. Uncheck the option \*Allow anonymous read access\*. Select \*Save\*. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/admin-password-reset-instructions.adoc | main | jenkins | [
-0.0011895138304680586,
-0.006845954805612564,
-0.0162323210388422,
-0.03935562074184418,
0.030380012467503548,
0.017742009833455086,
-0.056447871029376984,
-0.08450464904308319,
0.03695320338010788,
0.045163948088884354,
-0.05802540481090546,
-0.018152814358472824,
0.0008451382163912058,
... | -0.021675 |
= Reverse proxy - IIS In situations where you have existing web sites on your server, you may find it useful to run Jenkins (or the servlet container that Jenkins runs in) behind IIS, so that you can bind Jenkins to the part of a bigger website that you may have. This section discusses some of the approaches for doing this. \*Make sure that you change the Jenkins httpListenAddress from its default of 0.0.0.0 to 127.0.0.1 or configure the firewall to block request on the port Jenkins is bound to, otherwise any IIS-level restrictions can be easily bypassed by accessing the Jenkins port directly.\* == Requirements \* IIS 7.0 or greater. \*\* IIS 8.5 or greater if you want https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-85/certificate-rebind-in-iis85[Certificate Rebind]. \* https://www.iis.net/downloads/microsoft/url-rewrite[URL Rewrite 2.1] or greater. \*\* As the https://blogs.iis.net/iisteam/url-rewrite-v2-1[announcement] explains, it introduces a feature flag to turn off the default non-compliant-RFC3986 behavior. Which is what we want. \* https://www.iis.net/downloads/microsoft/application-request-routing[Application Request Routing] 3.0 or greater. \* Server access == Example use case I have a dedicated Jenkins installation on a Windows Server 2012 R2 server with a Common Name of \*VRTJENKINS01\* in the Active Directory domain \*acme.example\* and is reachable by the Fully Qualified Domain Name \*vrtjenkins01.acme.example\*. Additionally Jenkins runs on port \*8080\* and already listens to \*127.0.0.1\* instead of 0.0.0.0 and the server has additional DNS names: \*jenkins\* and \*jenkins.acme.example\*. I want to have an IIS installation which acts as a TLS/SSL terminating reverse proxy. In combination with our in-house Active Directory Certificate Services (ADCS, Microsoft's Certificate Authority software) this should make certificate management a lot easier since Windows can be configured to automatically renew certificates, and the IIS 8.5+ Certificate Rebind feature can listen to renewal events (which contain the fingerprints of both the old and new certificate) and update the relevant bind(s) to use the fresh certificate. This would ensure that after the initial manual request it would only be necessary to manually change TLS/SSL related settings when the set of Alternate Subject Names on the certificate IIS presents should change. IIS will only have to act as 1) a reverse proxy for Jenkins 2) redirect non-canonical URLs to the canonical URL: \_\https://jenkins.acme.example/\_ I have installed the IIS (8.5) role using the \_Add Roles and Features Wizard\_ with the all the default and also the following non-default features: \* HTTP Redirection (Under \_Common HTTP Features\_, to redirect \http(s)://jenkins/, etc. to https://jenkins.acme.example/) \* WebSocket Protocol (Under \_Application Development\_, because I felt like it) Then I installed URL Rewrite and Application Request Routing. == Configuration Time === Enabling Reverse Proxy functionality . In the \_Internet Information Services (IIS) Manager\_ click on the VRTJENKINS01 server. . Go to \_Application Request Routing Cache\_. . In the \_Actions\_ panel click on \_Server Proxy Settings...\_ . Enable the proxy . Disable the \_Reverse rewrite host in response header\_ .. Don't worry, it will work, just follow the rest of the instructions . Set the \_Response buffer threshold (KB)\_ to 0. .. This helps to prevent HTTP 502 errors on Jenkins' Replay pages. . Apply (the \_Actions\_ panel again) === Configuring TLS/SSL Out of scope, there are enough tutorials on the rest of the interwebs for this part. The rest of this tutorial will assume it has been configured with a certificate trusted by your browser of choice. === Configuring rules for response rewriting . Go to the \_Default Web Site\_ . Go to \_\_URL Rewrite\_\_ . In the \_Actions\_ panel click \_View Server Variables...\_ . Add the following is not already define on the server level: .. Name: \*HTTP\_FORWARDED\* . Click on \_Back to Rules\_ . \_Click on Add Rule(s)...\_ . Select | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-iis.adoc | main | jenkins | [
-0.03236507251858711,
0.02682611346244812,
-0.024292508140206337,
0.02268509939312935,
-0.0557883158326149,
-0.08910734206438065,
-0.05921342223882675,
-0.020134147256612778,
-0.012805537320673466,
-0.0025880029425024986,
-0.069497250020504,
-0.02617904543876648,
0.03648558631539345,
0.024... | 0.053407 |
rewriting . Go to the \_Default Web Site\_ . Go to \_\_URL Rewrite\_\_ . In the \_Actions\_ panel click \_View Server Variables...\_ . Add the following is not already define on the server level: .. Name: \*HTTP\_FORWARDED\* . Click on \_Back to Rules\_ . \_Click on Add Rule(s)...\_ . Select \_Reverse Proxy\_ and click on OK . Enter \_jenkins.acme.example\_ and click on OK . Open the rule you just created . Under \_Conditions\_ add: .. Condition input: \*\{CACHE\_URL}\* .. Pattern: \*^(http|ws)s://\* . Under \_Server Variables\_ add: .. Name: \*HTTP\_FORWARDED\*, Value: \*for=\{REMOTE\_ADDR};by=\{LOCAL\_ADDR};host="\{HTTP\_HOST}";proto="https"\*, Replace: yes ... Jenkins runs under Jetty, Jetty supports https://tools.ietf.org/html/rfc7239[RFC7239], so all should be well. . Under Action change: .. Rewrite URL to \*\{C:1}\://jenkins.acme.example:8080\{UNENCODED\_URL}\* ... Note that there is no slash between the port number and the opening curly bracket .. \*Remove\* the check from the \*Append query string\* checkbox . Apply the changes. . Edit \_C:\Windows\System32\drivers\etc\hosts\_ so that \*jenkins.acme.example\* points to 127.0.0.1 .. When resolving names Windows will check if the name is its own name before consulting the hosts file. Meaning that adding \_vrtjenkins01\_ or \_vrtjenkins01.acme.example\_ to the hosts file won't have any effect. ... The hosts file will however be consulted before consulting the DNS infrastructure === Experiencing the dreaded "It appears that your reverse proxy set up is broken." error for yourself . \https://jenkins.acme.example/configure . Configure the \_Jenkins URL\_ to be \*\*\https://jenkins.acme.example/\*\* and save the change . Go to \_Security\_ and enable \_Enable proxy compatibility\_ if you have already enabled \_Prevent Cross Site Request Forgery exploits\_ . Go to \https://jenkins.acme.example/manage . You will still experience the "It appears that your reverse proxy set up is broken." as expected .. If you do not get that at this point, then that is very weird... Continue anyway. . Right click the \_System\_ link and choose to inspect the element. .. Make sure you are still on the Manage page as you will want it as your referrer . Change the value of the \_href\_ attribute to be \_administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test\_ . Open the link you just changed in a new tab. .. Keep this tab open . Observe the "\https://jenkins.acme.example/manage vs http:" error and bask in its glory .. a white page served with HTTP status code is 200 indicates all is well ... If you do get that at this point, then that is very weird... Continue anyway. === Fixing the errors . In IIS Manager got to \_Application Pools\_ then edit \_DefaultAppPool\_ so that the \_.NET CLR version\_ is \*No Managed Code\* .. You might find that this is not necessary (at far as you can tell) for your setup, since IIS will only act as a TLS/SSL offloading reverse proxy, we don't need it. . Then go to \_Sites\_ → \_Default Web Site\_ → \_Request Filtering\_ and in the \_Actions\_ panel choose \_Edit Feature Settings...\_ and turn on \*Allow double escaping\* .. This is so IIS forwards URLs like \https://jenkins.acme.example/%2525 to Jenkins instead of showing an IIS error page . Last, but not least, go to \_Sites\_ → \_Default Web Site\_ → \_\_Configuration Editor\_\_ and change the \_Section\_ to \_system.webServer/rewrite/rules\_ . Now you should see the URL Rewrite 2.1 property \_useOriginalURLEncoding\_ listed, if not install URL Rewrite 2.1 using the x86 or x64 installer, not the WebPI one and resume from here after a reboot. . Change \_useOriginalURLEncoding\_ to \*False\* .. As the URL Rewrite 2.1 announcement this will change the value of \{UNENCODED\_URL} to make it \_RFC3986\_ and usable for reverse proxy forwarding purposes .. original as in pre 2.1 behaviour. . Refresh that tab you were supposed to keep open, or recreate it. .. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-iis.adoc | main | jenkins | [
-0.0040985154919326305,
0.047897059470415115,
0.03742823749780655,
0.03125210851430893,
-0.0667153000831604,
-0.0972907543182373,
-0.040786098688840866,
-0.043330732733011246,
-0.015587731264531612,
0.09132754802703857,
-0.05234699323773384,
-0.02836763858795166,
0.008301764726638794,
-0.0... | -0.012067 |
Change \_useOriginalURLEncoding\_ to \*False\* .. As the URL Rewrite 2.1 announcement this will change the value of \{UNENCODED\_URL} to make it \_RFC3986\_ and usable for reverse proxy forwarding purposes .. original as in pre 2.1 behaviour. . Refresh that tab you were supposed to keep open, or recreate it. .. Again, take some time to bask in its glory . It should now be white, also the Manage page should no longer complain! === Continue configuring IIS Some of the things you might want but I won't cover: \* \_Hypertext Strict Transport Security\_ headers \* Redirecting from non canonical URLs to the canonical URL (ok, sort of covered this in the web.config example) \* The X-UA-Compatibility header so that Internet Explorer 11 (or 9, or ...) won't claim to be IE 7 for intranet sites \* Use IIS Crypto to configure cipher suites \* ... === A working web.config \*web.config\* [source,xml] ---- xml version="1.0" encoding="UTF-8"? ---- | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-iis.adoc | main | jenkins | [
-0.005990208592265844,
0.018997788429260254,
0.07979210466146469,
0.02613258920609951,
-0.038104310631752014,
-0.05997622013092041,
0.013245359994471073,
-0.07581421732902527,
-0.04864555597305298,
0.05392557755112648,
-0.04962170124053955,
0.014951544813811779,
0.016389664262533188,
0.018... | 0.015959 |
= Backing-up/Restoring Jenkins Having good backups of your Jenkins controller is critically important. Backups are used for: \* Disaster recovery. \* Recovering an older configuration (an accidental configuration change may not be discovered for some time). \* Recovering a file that is corrupted or was deleted accidentally. This page discusses the following: \* How to create a backup \* Files that should be backed up \* How to validate a backup to ensure that it is usable == Creating a Backup Various schemes can be used to create backups. These are discussed in this section: \* Filesystem snapshots \* Plugins for backup \* Write a shell script that backs up the Jenkins controller === Filesystem snapshots Filesystem snapshots provide maximum consistency for backups. They also run faster than live backups, reducing the possibility of copying different data at different time points. They are supported by: \* The Linux Logical Volume Manager (LVM) \* Linux btrfs \* Solaris ZFS (which also supports incremental backups) \* FreeBSD ZFS \* OpenZFS on Linux \* Some other file system architectures \* Many cloud providers \* Some separate storage devices also let you create snapshots at the storage level. === Plugins for backup Several plugins are available for backup. From the main menu select \_Manage Jenkins\_, then go to \_Plugins>Available\_ and search for \*\*backup\*\*. Note that only the link:https://plugins.jenkins.io/thinBackup/[thinBackup Plugin] of the open source plugins is currently being maintained. You can try the other plugins but you may have problems with them. === Writing a shell script for backups You can write your own shell script that copies the appropriate files and directories to a backup location. Use link:https://man7.org/linux/man-pages/man8/cron.8.html[cron] to schedule when the backup script runs. The shell script should create a directory such as `/mnt/backup` to which the backup will be written; be sure that you have write permissions to that directory. Consider creating `/mnt/backup` as a separate filesystem with its own mount point. An alternative method is to create a subdirectory in `/var`. Note that if you use this method, you might need to use the \*\*sudo\*\* command to execute the restore operation. Backing up to `/tmp` is not advised because `/tmp` may be cleaned on reboot. Create a unique identifier for each backup (use a timestamp, for example) to ensure that today's backup does not overwrite yesterday's backup. Writing files to a local file system is the fastest way to take the backup. Consider copying the completed backup to a remote backup server or device for long term storage. == Back up the Controller Key Separately \*Never include the controller key in your Jenkins backup!\* The controller key is used to encrypt data in the \_secrets\_ directory that secures credentials. It is stored in the \_$JENKINS\_HOME/secrets/hudson.util.Secret\_ file in the \_$JENKINS\_HOME/secrets/\_ directory and encrypted with `master.key`. If you need to restore a system from a backup, you will need this file. And, if someone else accesses your backups and has this key, they have full access to all your information. You should treat your controller key like you treat your SSH private key and NEVER include it in a regular backup. Instead, back up the `master.key` file separately and store it in a very secure location away from your other backups. It is a very small file that is seldom changed. If you need to do a full system restore, you will need to restore the rest of the system and then apply the backup of the `master.key` file separately. == Which Files Should Be Backed Up? The number of files you back up can affect both the time required to run the | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/backing-up.adoc | main | jenkins | [
-0.10669206082820892,
-0.017448250204324722,
-0.02782829850912094,
-0.0012789159081876278,
0.07498431950807571,
-0.04319208860397339,
-0.0810401439666748,
0.0003700325032696128,
0.02151092328131199,
0.018415452912449837,
-0.011662528850138187,
0.04205470159649849,
0.033436909317970276,
-0.... | 0.07529 |
need to do a full system restore, you will need to restore the rest of the system and then apply the backup of the `master.key` file separately. == Which Files Should Be Backed Up? The number of files you back up can affect both the time required to run the backup and the size of the resulting backup. It also impacts the complexity of restoring the system from the backup. Here we discuss why various files should be backed up and list some files that could safely be excluded from at least some backups. [#jenkins\_home] === $JENKINS\_HOME Backing up the entire `$JENKINS\_HOME` directory preserves the entire Jenkins controller. To restore the system, just copy the entire backup to the new system. Note, however, that `JENKINS\_HOME` includes a number of files that do not really need to be backed up. Selecting specific directories and files to back up yields smaller backups but may require a greater effort to restore a system. One approach is to back up different directories on different schedules. === Configuration files Configuration files are stored directly in the `$JENKINS\_HOME` directory. `./config.xml` is the main Jenkins configuration file. Other configuration files also have the `.xml` suffix. Specify `$JENKINS\_HOME/\*.xml` to back up all configuration files. Configuration files can also be stored in an SCM repository. This keeps copies of all previous versions of each file that can be retrieved using standard SCM facilities. === ./jobs Subdirectory The `$JENKINS\_HOME/jobs` directory contains information related to all the jobs you create in Jenkins. \* \*\*./builds\*\* -- Contains build records \* \*\*./builds/archive\*\* -- Contains archived artifacts \*\* Back this up if it is important to retain these artifacts long-term \*\* These can be very large and may make your backups very large \* \*\*./workspace\*\* -- Contains files checked out from the SCM \*\* It is usually not necessary to back up these files. You can perform a clean checkout after restoring the system. \* \*\*./plugins/\*.hpi\*\* -- Plugin packages with specific versions used on your system \* \*\*./plugins/\*.jpi\*\* -- Plugin packages with specific versions used on your system === What may not need to be backed up The following files and directories do not usually need to be included in every routine backup because you can download the latest version when you are restoring a system. However, some disaster recovery experts recommend against doing any upgrades while restoring the system, to avoid delays caused by compatibility issues that might arise. If your disaster recovery plan specifies that you restore the system using the same software versions that were previously running, you can make an infrequent backup of the system and all downloaded tools and use that to restore the system.. \* \*\*./war\*\* -- Exploded `war` file \*\* To restore a system, download the latest `war` file. \* \*\*./cache\*\* -- Downloaded tools \*\* To restore a system, download the current version of the tools. \* \*\*./tools\*\* -- Extracted tools \*\* To restore a system, extract the tools again. \* \*\*./plugins/xxx\*\* -- Subdirectories of installed plugins \*\* These will be automatically populated on the next restart. == Validating a backup Your backup strategy should include validation of each backup. You do not want to learn that your backup is no good when you need it! A simple way to validate a full backup is to restore it to a temporary location. Create a directory for the test validation (such as \*\*/mnt/backup-test\*\*) and restore the backup to that directory. Set $JENKINS\_HOME to point to this directory, specifying a random HTTP port so you do not collide with the real Jenkins controller: [source,bash] ---- export JENKINS\_HOME=/mnt/backup-test ---- Now | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/backing-up.adoc | main | jenkins | [
-0.02692319266498089,
-0.0034140204079449177,
0.028986196964979172,
-0.006902450695633888,
0.05504915118217468,
-0.00139396742451936,
-0.03890655189752579,
0.03196951746940613,
-0.008001512847840786,
-0.0006292672478593886,
-0.03285312280058861,
0.06463925540447235,
0.07108310610055923,
-0... | -0.001234 |
it to a temporary location. Create a directory for the test validation (such as \*\*/mnt/backup-test\*\*) and restore the backup to that directory. Set $JENKINS\_HOME to point to this directory, specifying a random HTTP port so you do not collide with the real Jenkins controller: [source,bash] ---- export JENKINS\_HOME=/mnt/backup-test ---- Now execute the restored Jenkins controller: [source,bash] ---- java -jar jenkins.war --httpPort=9999 ---- == Summary \* Making backups is a Jenkins best practice. \* Backups are critical for disaster recovery. \* Always set up a backup policy that defines: \*\* The configurations and records that need to be saved from the controller \*\* How often backups should be taken \*\* Where backups should be stored \* Validate your backups. \*\* You should periodically check whether your backups are intact and can be used to meet your recovery objectives. == Going further Some recommended readings on this subject: \* link:https://www.cloudbees.com/blog/why-smart-efficient-backup-and-restore-techniques-are-essential-jenkins-production-server[Why Smart, Efficient Backup and Restore Techniques are Essential with Jenkins Production Server] \* link:https://plugins.jenkins.io/backup/[Backup Plugin] \* link:https://plugins.jenkins.io/thinBackup/[thinBackup Plugin] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/backing-up.adoc | main | jenkins | [
-0.0793716162443161,
0.004163482692092657,
-0.022671779617667198,
0.004859037231653929,
0.0415608175098896,
-0.024178357794880867,
-0.050574030727148056,
-0.014219289645552635,
0.05290938541293144,
0.008233648724853992,
-0.01796751841902733,
0.0323387049138546,
0.06720628589391708,
-0.0598... | 0.080765 |
ifdef::backend-html5[] ifndef::env-github[:imagesdir: ../../resources/managing] :notitle: :description: :author: :email: jenkinsci-users@googlegroups.com :sectanchors: :toc: left endif::[] = FIPS-140 It may be possible to run Jenkins in a FIPS-140 compliant manner when the <<../managing/system-properties#jenkins-security-fips140-compliance, compliance flag>> is enabled, and the servlet container, the JVM, and the host OS are all appropriately configured. How to configure the servlet container, JVM and host are out of scope of the Jenkins community project as this is a complex area with many pitfalls and gotchas. Some Jenkins features may not work or be disabled. [IMPORTANT] ==== The Jenkins community does not actively check Jenkins or Plugins for link:https://csrc.nist.gov/pubs/fips/140-2/upd2/final[FIPS-140] compliance issues. ==== == Plugins Plugins may or may not honour a request to run in FIPS-140 compliance mode. Before you install or upgrade any plugin, you should check the plugin's code to ensure it adheres to the FIPS-140 standard. == What FIPS-140 mode does If you enable <<../managing/system-properties#jenkins-security-fips140-compliance, FIPS-140 mode>>, it provides a hint to Jenkins and any plugins that have opted in that they should prefer cryptographic algorithms that \*may\*.footnote:[Algorithms are not approved, rather a specific implementation of a specific algorithm is approved. However, the implementation used at runtime depends on the JVM, JVM configuration, and the host OS. As this is outside the scope of the Jenkins project, the algorithms targeted are available from at least one link:https://csrc.nist.gov/projects/cryptographic-module-validation-program/validated-modules/search[FIPS-140 compliant provider], namely the link:https://csrc.nist.gov/projects/cryptographic-module-validation-program/certificate/3514[BouncyCastle FIPS library].] be FIPS-140 approved. This may mean that some features are disabled entirely, or may use a less secure (but compliant) form of cryptography than normal. == What FIPS-140 mode does not do If any code from the JVM, servlet container, Jenkins, or any plugin requests a non-compliant algorithm, this will still be the case, and the request may be honoured. For example, this mode cannot configure the JVM, so TLS connections to external secure web sites might still use non-compliant cryptography. Additionally, Jenkins cannot ensure that plugins will even use encryption at all, when appropriate. At the end of the day, just because Jenkins and plugins run when FIPS-140 mode is enabled does not mean that it adheres to the USA government standard. == How to run a fully FIPS-140 compliant Jenkins As previously mentioned, the host, JVM, and the servlet container all need to be configured appropriately to ensure that Jenkins is FIPS-140 compliant. Extreme care should be taken when installing or upgrading plugins as they may or may not be FIPS-140 compliant, and they may introduce code that is non-compliant or otherwise change the JVM configuration so that it breaks compliance. The Jenkins community does not support Jenkins FIPS-140 mode, and due to the complex nature of JVM and servlet configuration that can change between versions, does not provide documentation for the full configuration required to run Jenkins in a fully FIPS-140 compliant manner. If you need to run Jenkins in a way that it is FIPS-140 compliant, it is recommended that you obtain support from a commercial vendor. The Jenkins community may be able to fix issues relating to FIPS-140 compliance; these will be treated as any other bug report or feature request. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/FIPS-140.adoc | main | jenkins | [
-0.030171096324920654,
0.0013356124982237816,
-0.024666868150234222,
-0.027397610247135162,
0.08173508942127228,
-0.05281775817275047,
-0.06852845102548599,
-0.03619039058685303,
-0.005076240282505751,
0.033238790929317474,
-0.014579851180315018,
-0.0286262147128582,
-0.036507055163383484,
... | 0.074234 |
= Diagnosing Errors This page provides guidelines about diagnosing the most common types of errors you may see when using Jenkins. [#out-of-memory-error] == Out Of Memory Errors `OutOfMemoryError` errors may happen for many different reasons: - Your Jenkins is growing in data size, requiring a bigger heap space. In this case you just want to give it a bigger heap. - Your Jenkins is temporarily processing a large amount of data (like test reports), requiring a bigger head room in memory. In this case you just want to give it a bigger heap. - Your Jenkins is leaking memory, in which case we need to fix that. - The Operating System kernel is running out of virtual memory. Which category your `OutOfMemoryError` falls into is not always obvious, but here are a few useful techniques to diagnose the problem. - Use https://visualvm.github.io/[VisualVM], attach to the running instance, and observe the memory usage. Does the memory max out while loading Jenkins? If so, it probably just needs a bigger memory space. Or is it slowing creeping up? If so, maybe it is a memory leak. - Do you consistently see `OutOfMemoryError` around the same phase in a build? If so, maybe it just needs a bigger memory. - In cases where virtual memory is running short the kernel `OutOfMemoryError` killer may forcibly kill Jenkins or individual builds. If this occurs on Linux you may see builds terminate with exit code `137` (`128` + signal number for `SIGKILL`). The `dmesg` command output will show log messages that will confirm the action that the kernel took. If you think it's a memory leak, the Jenkins team needs to get the heap dump to be able to fix the problem. There are several ways to go about this. - Run JVM with `-XX:+HeapDumpOnOutOfMemoryError` so that JVM will automatically produce a heap dump when it hits `OutOfMemoryError`. - You can run `jmap -dump:live,file=/tmp/jenkins.hprof pid` where pid is the process ID of the target Java process. - Use https://visualvm.github.io/[VisualVM], attach to the running instance, and obtain a heap dump - If your Jenkins runs at `http://server/jenkins/`, request `http://server/jenkins/heapDump` with your browser and you'll get the heap dump downloaded. - If you are familiar with one of many Java profilers, they normally offer this capability, too. Once you obtain the heap dump, please post it somewhere, then open an issue (or look for a duplicate issue), and attach a pointer to it. Please be aware that heap dumps may contain confidential information of various sorts. If the full heap dump is too big, please try to get us the heap histogram (`jmap -histo:live pid`). In the past, the distributed build support has often been a source of leakage (as this involves in a distributed garbage collection.) To check for this possibility, visit links like `http://yourserver/jenkins/computer/YOURAGENTNAME/dumpExportTable`. If this show too many objects, they may be leaks. === Analyzing the heap dump yourself If you cannot let us inspect your heap dump, we need to ask you to diagnose the leak. - First, find the objects with biggest retention size. Often they are various Maps, arrays, or buffers. - Next, find the path from that object to GC root, so that you can see which Jenkins object owns those big objects. Report the summary of those findings to the list and we'll take it from there. === Using VisualVM Unless you already have a preferred memory profiling tool, VisualVM is recommended for analyzing heap dumps. It is a standalone version of the NetBeans profiler, distributed with the Oracle JDK. Run `jvisualvm` and use \*File » Load\* and select the | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/diagnosing-errors.adoc | main | jenkins | [
0.026630476117134094,
0.010801841504871845,
-0.004070905968546867,
0.06477765738964081,
0.050415292382240295,
-0.08950990438461304,
-0.05710609257221222,
0.06715228408575058,
0.031841639429330826,
0.028292067348957062,
-0.0664936825633049,
-0.038676775991916656,
-0.007852907292544842,
-0.0... | 0.047175 |
list and we'll take it from there. === Using VisualVM Unless you already have a preferred memory profiling tool, VisualVM is recommended for analyzing heap dumps. It is a standalone version of the NetBeans profiler, distributed with the Oracle JDK. Run `jvisualvm` and use \*File » Load\* and select the heap dump. In the \*Classes\* tab, look for a class with a suspiciously large number of instances, if not already identified by `jmap -histo`. For example, to debug a Groovy script leak, type `GroovyClassLoader` in the filter field and double-click the line with no `$` in it (just `groovy.lang.GroovyClassLoader`). In the \*Instances\* tab you should now see all instances. Click on some at random. (If there are more than 500, they will be broken into groups of 500, with the first expanded; so to get a representative instance "from the middle", collapse the first group, expand a group in the middle, and select some instance from that group.) Under \*References\*, right-click `this` and select \*Show Nearest GC Root\*. Right-click the selected item in the tree and select \*Copy Path From Root\*. Paste this text, for several examples, into a text file and attach it to a bug report—or continue your investigation into plugin source code. [#how-to-report-a-bug] == How to Report a Bug For easier bug reporting, you can get the full list of plugins with this Groovy script that you can run in \*\*Jenkins > Manage Jenkins > Script Console\*\*: [source,java] ---- println("Jenkins: ${Jenkins.instance.getVersion()}") println("OS: ${System.getProperty('os.name')} - ${System.getProperty('os.version')}") println("Java: ${System.getProperty('java.version')} - ${System.getProperty('java.vm.vendor')} (${System.getProperty('java.vm.name')})") println "---" Jenkins.instance.pluginManager.plugins .collect() .sort { it.getShortName() } .each { plugin -> println("${plugin.getShortName()}:${plugin.getVersion()}") } return ---- xref:community:ROOT:report-issue.adoc[Report an issue] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/diagnosing-errors.adoc | main | jenkins | [
-0.027542077004909515,
0.023073872551321983,
-0.050302132964134216,
-0.042747147381305695,
0.05335202440619469,
-0.08296402543783188,
0.026326142251491547,
0.04664969444274902,
-0.06501714885234833,
0.004660484381020069,
-0.06474380940198898,
-0.08520478010177612,
0.006451268680393696,
-0.... | -0.00102 |
= Viewing logs == Logs on the system When running `jenkins.war` manually with `java -jar jenkins.war`, all logging information by default is output to standard out. Many Jenkins native packages modify this behavior to ensure logging information is output in a more conventional location for the platform. === Linux (rpm and deb) By default logs can be viewed by running `journalctl -u jenkins.service`. To customize the log location, run `systemctl edit jenkins` and add the following: [source] ---- [Service] Environment="JENKINS\_LOG=%L/jenkins/jenkins.log" ---- === Windows (msi) By default, logs should be at `%JENKINS\_HOME%/jenkins.out` and `%JENKINS\_HOME%/jenkins.err`, unless customized in `%JENKINS\_HOME%/jenkins.xml`. === macOS Log files should be at `+/var/log/jenkins/jenkins.log+`, unless customized in `org.jenkins-ci.plist`. === War file When Jenkins is started from a command line with `+java -jar jenkins.war+`, the log file will be written to the `+JENKINS\_HOME+` directory. If no value is assigned to the `+JENKINS\_HOME+` environment variable, the log file will be written to the `+.jenkins/log+` directory. === Docker If you run Jenkins inside Docker as a detached container, you can use `docker logs ` to view the Jenkins logs. == Logs in Jenkins Jenkins uses `java.util.logging` for logging. The `java.util.logging` system by default sends every log above `INFO` to stdout. Jenkins is equipped with a GUI for configuring/collecting/reporting log records of your choosing. This page shows you how to do this. First, select the "System Log" from the "Manage Jenkins" page: image::logging-manage-screen.png["Manage Jenkins"] From there, you can create a custom log recorder, which helps you group relevant logs together while filtering out the noise. image::logging-log-recorders.png["Log Recorders"] Choose a name that makes sense to you. image::logging-enter-name.png["Enter log recorder name"] You'll be then asked to configure loggers and their levels whose output you'd like to collect. Depending on which part of Jenkins you monitor, you'll need to specify different loggers. Tell us the symptom of your problem in the users list and we should be able to tell you where you need to look. Also, this is really just a wrapper around the java.util.logging package, so if you program in Java, you might be able to guess where to look. image::logging-logger-config.png["Specify loggers"] Once the set up is complete, Jenkins will start collecting data. The collected logs are available from the web UI. == Making custom logs available outside of the web UI The simplest solution is to install the link:https://plugins.jenkins.io/support-core[Support Core Plugin], which causes custom logs to be written to disk automatically. == Debug logging in Jenkins 1. Create a file `logging.properties` 2. Define the logging levels and a `ConsoleHandler` 3. Pass this file to the JVM by adding the system property `-Djava.util.logging.config.file=/logging.properties`. An example \*logging.properties\* is included below. NOTE: For a normal production environment the default level is INFO, it is not advised to have debug log in production. [source] ---- handlers = java.util.logging.ConsoleHandler # see https://docs.oracle.com/en/java/javase/17/docs/api/java.logging/java/util/logging/SimpleFormatter.html java.util.logging.SimpleFormatter.format = [%1$tF %1$tT][%4$-6s][%2$s] %5$s %6$s %n # Keep this level to ALL or FINEST or it will be filtered before applying other levels java.util.logging.ConsoleHandler.level = ALL # Default level .level= INFO # High verbosity for a dedicated package com.myplugin.\* com.myplugin.level = ALL ---- | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/viewing-logs.adoc | main | jenkins | [
0.005455566570162773,
0.029648439958691597,
-0.0031543378718197346,
-0.025612087920308113,
0.05165877193212509,
-0.07144401967525482,
-0.03609234467148781,
-0.023591743782162666,
0.07094792276620865,
0.04145815223455429,
-0.051389776170253754,
-0.031032372266054153,
0.001480241073295474,
0... | 0.057266 |
= Reverse proxy - Issues [#jenkins-says-my-reverse-proxy-setup-is-broken] == Symptoms An error message is displayed in the "Manage Jenkins" page `+It appears that your reverse proxy setup is broken+` NOTE: This message can also appear if you don't access Jenkins through a reverse proxy: Make sure the Jenkins URL configured in the System Configuration matches the URL you're using to access Jenkins. [#troubleshooting] == Background For a reverse proxy to work correctly, it needs to rewrite both the request and the response. Request rewriting involves receiving an inbound HTTP call and then making a forwarding request to Jenkins (sometimes with some HTTP headers modified, sometimes not). Failing to configure the request rewriting is easy to catch, because you just won't see any pages at all. But correct reverse proxying also involves \*one of two options\*, EITHER \* \*rewrite the response\* with a "Location" header in the response, which is used during redirects. Jenkins sends `Location:{nbsp}\http://actual.server:8080/jenkins/foobar` and the reverse proxy must rewrite it to `Location:{nbsp}\http://nice.name/jenkins/foobar`. Unfortunately, failing to configure this correctly is harder to catch; OR \* \*set the headers\* `+X-Forwarded-Host+` (and perhaps `+X-Forwarded-Port+`) on the forwarded request. Jenkins will parse those headers and generate all the redirects and other links on the basis of those headers. Depending on your reverse proxy it may be easier to set `+X-Forwarded-Host+` and `+X-Forwarded-Port+` to the hostname and port in the original `+Host+` header respectively or it may be easier to just pass the original `+Host+` header through as `+X-Forwarded-Host+` and delete the `+X-Forwarded-Port+` # header from the request. You will also need to set the `+X-Forwarded-Proto+` header if your reverse proxy is changing from `+https+` to `+http+` or vice-versa. Jenkins has proactive monitoring to make sure this is configured correctly. It uses XmlHttpRequest to request a specific URL in Jenkins (via relative path, so this will always get through provided the request is properly rewritten), which will then redirect the user to another page in Jenkins (this only works correctly if you configured the response rewriting correctly), which then returns 200. This error message indicates that this test is failing - and the most likely cause is that the response rewriting is misconfigured. See the xref:system-administration:reverse-proxy-configuration.adoc[configuration examples] for additional tips about configuring a reverse proxy. Be sure to set the `+X-Forwarded-Proto+` header if your reverse proxy is accessed via HTTPS and then Jenkins itself is accessed via HTTP i.e. proxying HTTPS to HTTP. include::partial$\_context\_path.adoc[] Changing the context path of Jenkins with a reverse proxy is fraught with danger. There are many URLs that must be rewritten. Even if you rewrite all the URLs in HTML files, you may miss some in JavaScript, CSS, or XML resources. While it is technically possible to use rewrite rules to change the context path, you should be aware that it would be a lot of work to find and fix everything in your rewrite rules and the reverse proxy will spend most of its time rewriting responses from Jenkins. Much easier to change Jenkins to run at the context path your reverse proxy is expecting, e.g. if your reverse proxy is forwarding requests at \https://manchu.example.org/foobar/ to Jenkins then you could just use `+java -jar jenkins.war --prefix=/foobar+` to start jenkins using `+/foobar+` as the context path == Further Diagnosis For further diagnosis, try using cURL: [source,sh] ---- BASE=administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor curl -iL -e http://your.reverse.proxy/jenkins/manage \ http://your.reverse.proxy/jenkins/${BASE}/test ---- (assuming your Jenkins is located at \http://your.reverse.proxy/jenkins/ - and is open to anonymous read access) | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-troubleshooting.adoc | main | jenkins | [
-0.04372057691216469,
0.014528397470712662,
0.1330633908510208,
0.006343765649944544,
-0.07176408171653748,
-0.103224016726017,
-0.0897224098443985,
-0.0875101089477539,
-0.005213278345763683,
0.03947848454117775,
-0.06981200724840164,
-0.02346331812441349,
0.011911346577107906,
-0.0122434... | -0.01974 |
-e http://your.reverse.proxy/jenkins/manage \ http://your.reverse.proxy/jenkins/${BASE}/test ---- (assuming your Jenkins is located at \http://your.reverse.proxy/jenkins/ - and is open to anonymous read access) | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-troubleshooting.adoc | main | jenkins | [
-0.0204527098685503,
0.029226791113615036,
0.005028024315834045,
0.0036384332925081253,
-0.06400185823440552,
-0.10254034399986267,
-0.053809765726327896,
-0.015477539040148258,
0.033446405082941055,
0.03795379027724266,
-0.022009463980793953,
-0.006163487210869789,
-0.026973916217684746,
... | 0.02774 |
= System Administration This chapter for system administrators of Jenkins servers and nodes. It will cover system maintenance topics including security, monitoring, and backup/restore. Users not involved with system-level tasks will find this chapter of limited use. Individual sections may assume knowledge of information from previous sections, but such assumptions will be explicitly called out and cross-referenced. If you are a Jenkins administrator and want to know more about managing Jenkins nodes and instances, see xref:managing:index.adoc[Managing Jenkins]. For an overview of content in the Jenkins User Handbook, see xref:getting-started:index.adoc[User Handbook Overview]. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/index.adoc | main | jenkins | [
-0.02539069950580597,
-0.006297033280134201,
-0.019862370565533638,
0.040759723633527756,
0.05976520851254463,
-0.07667790353298187,
0.03146237134933472,
-0.03800106421113014,
-0.04238985478878021,
0.03521957993507385,
-0.07362557202577591,
0.04694005101919174,
0.02297697402536869,
-0.0710... | 0.230486 |
= Authenticating scripted clients To make scripted clients (such as wget) invoke operations that require authorization (such as scheduling a build), use HTTP BASIC authentication to specify the user name and the API token. Earlier versions of Jenkins require you to specify your real password, and it is only available when your security realm is password-based (for example, OpenID, Crowd and CAS plugins authenticate you without a password, so you simply don't have any password!) Specifying the real password is still supported, but it is not recommended because the risk of revealing password, and the human tendency to reuse the same password in different places. The API token is available in your personal configuration page. Click your name on the top right corner on every page, then click "Configure" to see your API token. (The URL `+$root/me/configure+` is a good shortcut.) You can also change your API token from here. Note that Jenkins does not do any authorization negotiation. i.e. it immediately returns a 403 (Forbidden) response instead of a 401 (Unauthorized) response, so make sure to send the authentication information from the first request (aka "preemptive authentication"). == Shell with curl The `curl` command is available for most operating systems including Linux, macOS, Windows, FreeBSD, and more. [source,sh] ---- curl -X POST -L --user your-user-name:apiToken \ https://jenkins.example.com/job/your\_job/build ---- == Shell with wget NOTE: The `wget` command needs the `--auth-no-challenge` option to authenticate to Jenkins: [source,sh] ---- wget --auth-no-challenge \ --user=user --password=apiToken \ http://jenkins.example.com/job/your\_job/build ---- == Groovy script using cdancy/jenkins-rest The https://github.com/cdancy/jenkins-rest[cdancy/jenkins-rest client] greatly simplifies REST API access. The following Groovy code shows how to authenticate to Jenkins and get some system info: [source,groovy] ---- @Grab(group='com.cdancy', module='jenkins-rest', version='0.0.18') import com.cdancy.jenkins.rest.JenkinsClient JenkinsClient client = JenkinsClient.builder() .endPoint("http://127.0.0.1:8080") // Optional. Defaults to http://127.0.0.1:8080 .credentials("user:apiToken") // Optional. .build() println(client.api().systemApi().systemInfo()) ---- For additional information, see the https://github.com/cdancy/jenkins-rest/wiki[cdancy/jenkins-rest wiki]. == typescript script example using axios The following code shows how to create a job [source,typescript] ---- const credentials = `myusername:myapitoken`; const baseJenkinsUrl = "http://myjenkins:8080"; async function getCrumb() { return axios({ method: "get", url: baseJenkinsUrl + "/crumbIssuer/api/json", withCredentials: false, }); } getCrumb().then((response: any) => { let crumb = response.data; const base64Credentials = btoa(credentials); const authHeader = `Basic ${base64Credentials}`; // Create new job const requestConfig: AxiosRequestConfig = { method: "post", url: `${baseJenkinsUrl}/createItem?name=${jobName}`, headers: { Authorization: authHeader, [crumb.crumbRequestField]: crumb.crumb, "Content-Type": "application/xml", }, data: xmlconfig, }; axios(requestConfig); }); ---- [#Authenticatingscriptedclients-PerlLWPexampleforascriptedclient] == Perl LWP example for a scripted client The following Perl example uses the LWP module to start a Job via a "Trigger builds remotely" token: [source,perl] ---- # # Use LWP to run a Jenkins job # set authorization\_basic on the request object # to make use of BASIC HTTP authorization, apparently # already handling the preemptive part correctly this # way. # use strict; use warnings; use LWP; my $server = 'srvname'; my $srvurl = "http://$server/jenkins"; my $uagent = LWP::UserAgent->new; my $req = HTTP::Request->new( GET => "$srvurl/job/test/build?token=theTokenConfiguredForThisJob&cause=LWP+Test" ); $req->authorization\_basic('username@mydomain.com', 'apiToken'); my $res = $uagent->request($req); # Check the outcome of the response print "Result: " . $res->status\_line . "\n"; print $res->headers->as\_string; print "\n"; if (!$res->is\_success) { print "Failed\n"; } else { print "Success!\n"; # print $res->content, "\n"; } ---- [#Authenticatingscriptedclients-Javaexamplewithhttpclient4.3.x] == Java example with httpclient 4.3.x This will cause httpclient 4.3 to issue authentication preemptively: [source,java] ---- import java.io.IOException; import java.net.URI; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.AuthCache; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.impl.auth.BasicScheme; import org.apache.http.impl.client.BasicAuthCache; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; public class JenkinsScraper { public String scrape(String urlString, String username, String password) throws ClientProtocolException, IOException { URI uri = URI.create(urlString); HttpHost host = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()); CredentialsProvider | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/authenticating-scripted-clients.adoc | main | jenkins | [
-0.10519520193338394,
0.02244272455573082,
-0.02819531038403511,
0.014966062270104885,
-0.01756933517754078,
-0.06227618828415871,
-0.0318496935069561,
0.030161313712596893,
0.07715927064418793,
0.008534634485840797,
-0.09988512098789215,
-0.05244811996817589,
0.05264239013195038,
-0.01720... | 0.061211 |
import org.apache.http.client.AuthCache; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.impl.auth.BasicScheme; import org.apache.http.impl.client.BasicAuthCache; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; public class JenkinsScraper { public String scrape(String urlString, String username, String password) throws ClientProtocolException, IOException { URI uri = URI.create(urlString); HttpHost host = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()); CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials(new AuthScope(uri.getHost(), uri.getPort()), new UsernamePasswordCredentials(username, password)); // Create AuthCache instance AuthCache authCache = new BasicAuthCache(); // Generate BASIC scheme object and add it to the local auth cache BasicScheme basicAuth = new BasicScheme(); authCache.put(host, basicAuth); CloseableHttpClient httpClient = HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build(); HttpGet httpGet = new HttpGet(uri); // Add AuthCache to the execution context HttpClientContext localContext = HttpClientContext.create(); localContext.setAuthCache(authCache); HttpResponse response = httpClient.execute(host, httpGet, localContext); return EntityUtils.toString(response.getEntity()); } } ---- | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/authenticating-scripted-clients.adoc | main | jenkins | [
-0.022251809015870094,
0.08289279043674469,
-0.05604870617389679,
-0.08609878271818161,
-0.0148271843791008,
-0.08270973712205887,
-0.002100982703268528,
-0.012933659367263317,
0.06144582852721214,
0.039772506803274155,
-0.005144053138792515,
-0.046507373452186584,
0.02820146270096302,
-0.... | -0.013983 |
= Monitoring Jenkins NOTE: This page is under development, there will be more content added soon. See the {jira}WEBSITE-738[] EPIC for tasks related to this page, contributions are welcome! == Monitoring with Datadog - {plugin}datadog[Datadog plugin for Jenkins] - {plugin}metrics-datadog[Metrics-Datadog plugin for Jenkins] - https://www.datadoghq.com/blog/monitor-jenkins-datadog[Jenkins on Datadog] == Monitoring with Newrelic - https://opensource.newrelic.com/projects/newrelic/nr-jenkins-plugin[Jenkins on Newrelic] - https://newrelic.com/blog/best-practices/how-use-jenkins-integration-tests[Developing a Jenkins Integration Pipeline for the New Relic Infrastructure On-Host Integrations] == Monitoring with Prometheus and Grafana - {plugin}prometheus[Prometheus plugin for Jenkins] - https://medium.com/@eng.mohamed.m.saeed/monitoring-jenkins-with-grafana-and-prometheus-a7e037cbb376[How-To blog on Medium] == Monitoring with JavaMelody - {plugin}monitoring[Monitoring plugin for Jenkins] == Other Monitoring Plugins - {plugin}versioncolumn[Versions Node Monitors] - {plugin}systemloadaverage-monitor[Agents Monitoring for unix nodes] - {plugin}jqs-monitoring[Job/Queue/Slaves Monitoring] == Ping Thread Jenkins installs "ping thread" on every remoting connection, such as controller/agent connections, regardless of its transport mechanism (such as SSH, JNLP, etc.). The lower level of the Jenkins remoting protocol is a message oriented protocol, and a ping thread periodically sends a ping message that the receiving end will reply. The ping thread measures the time it takes for the reply to arrive, and if it's taking excessive time (currently https://github.com/jenkinsci/remoting/blob/master/src/main/java/hudson/remoting/Launcher.java[4 minutes] and configurable), then it assumes that the connection was lost and initiates the formal close down. This is to avoid an infinite hang, as some of the failure modes in network cannot be detected otherwise. The timeout is also set to a long enough value so that a temporary surge in the load or a long garbage collection pause will not trip off the close down. Ping thread is installed on both controller & agent; each side pings the other and tries to detect the problem from their own sides. The ping thread time out is reported through `+java.util.logging+`. In addition, the controller will also report this exception in the agent launch log. Note that some agent launchers, most notably SSH agents, writes all stdout/stderr outputs from the agent JVM into this same log file, so you need to be careful. See https://issues.jenkins.io/browse/JENKINS-25695[JENKINS-25695]. [#PingThread-Disablingpingthread] == Disabling ping thread Sometimes, for example https://wiki.jenkins.io/display/JENKINS/Remoting+issue[to diagnose the agent connection loss problem], you may want to disable the ping thread. This needs to be done in two places. Disable the controller from pinging agents by setting `+hudson.slaves.ChannelPinger.pingIntervalSeconds+` on the controller JVM to -1. You can also change the value in memory for a running Jenkins, if you don't want to restart Jenkins. Set `pingIntervalSeconds` and `pingTimeoutSeconds on the controller` JVM to -1: [source,groovy] ---- Jenkins.instance.injector.getInstance(hudson.slaves.ChannelPinger.class).@pingIntervalSeconds = -1 Jenkins.instance.injector.getInstance(hudson.slaves.ChannelPinger.class).@pingTimeoutSeconds = -1 ---- ---- The above will only affect newly connected agents. Existing connected agents will continue running pings. ---- To disable agents from pinging the controller, the system property [source,bash] ---- -Dhudson.remoting.Launcher.pingIntervalSec=-1 ---- needs to be set to agents. How to do this depends on the launcher. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/monitoring.adoc | main | jenkins | [
-0.0988384410738945,
-0.012001322582364082,
-0.04139257222414017,
0.057689420878887177,
-0.020411232486367226,
-0.10096951574087143,
-0.06193849816918373,
-0.06357362866401672,
-0.006961028091609478,
0.02045038901269436,
-0.036159925162792206,
-0.09804215282201767,
0.005932678934186697,
0.... | 0.172695 |
= Managing systemd services Beginning with Jenkins 2.332.1 and Jenkins 2.335, the Linux package installers use `systemd` to manage services. The RPM and deb package installers migrate configuration settings from System V `init` to `systemd` overrides. video::pwR9TPW2oG4[youtube,width=800,height=420] == Viewing service configurations The current service configuration of the Jenkins service as configured by the package installers and any overrides can be viewed with: [source,bash] ---- systemctl cat jenkins # /etc/systemd/system/jenkins.service # # This file is managed by systemd(1). Do NOT edit this file manually! # To override these settings, run: # # systemctl edit jenkins # # For more information about drop-in files, see: # # https://www.freedesktop.org/software/systemd/man/systemd.unit.html # [Unit] Description=Jenkins Continuous Integration Server Requires=network.target After=network.target [Service] Type=notify NotifyAccess=main ExecStart=/usr/bin/jenkins Restart=on-failure SuccessExitStatus=143 # /etc/systemd/system/jenkins.service.d/override.conf [Service] Environment="JAVA\_OPTS=-Djava.awt.headless=true" ---- == Overriding service configurations When installed on a modern Linux distribution running `systemd(1)`, the `systemd(1)` link:https://www.freedesktop.org/software/systemd/man/systemd.service.html[service unit] is delivered to: Debian:: `/lib/systemd/system/jenkins.service` Red Hat:: `/usr/lib/systemd/system/jenkins.service` openSUSE:: `/usr/lib/systemd/system/jenkins.service` The main service unit is read-only and not intended to be edited manually. It contains a large notice at the top of the file reminding the user that it is read-only. Values may be overridden in the drop-in unit (`override.conf` file) for the service. Edit the drop-in unit with: [source,bash] ---- # systemctl edit jenkins ---- The `override.conf` file is stored at `/etc/systemd/system/jenkins.service.d/override.conf` and can be used to customize the service. Note that such customizations must be done in a `[Service]` section in order to take effect. Example content of the `override.conf` file might include: [source] ---- [Unit] Description=My Company Jenkins Controller [Service] # Add JVM configuration options Environment="JAVA\_OPTS=-Djava.awt.headless=true -XX:+UseStringDeduplication" # Arbitrary additional arguments to pass to Jenkins. # Full option list: java -jar jenkins.war --help Environment="JENKINS\_OPTS=--prefix=/jenkins --javaHome=/opt/jdk-21" # Configuration as code directory Environment="CASC\_JENKINS\_CONFIG=/var/lib/jenkins/configuration-as-code/" ---- WARNING: `systemctl edit jenkins` creates the drop-in unit as `root` with 0644 (`-rw-r--r--`) permissions. The migration logic, on the other hand, creates the drop-in unit as `root` with 0600 (`-rw-------`) permissions. This might be of consequence if you store an HTTPS keystore location and/or password in the drop-in unit and also run jobs directly on the controller, a practice which the Jenkins project xref:user-docs:security:controller-isolation.adoc[explicitly discourages]. When in doubt, secure the drop-in unit by setting its permissions to 0600 with `chmod(1)`. The drop-in unit unifies configuration across all three distributions: Debian, Red Hat, and openSUSE. Also note that the drop-in unit is not overwritten on upgrades. NOTE: Unlike the System V `init(8)` configuration, the `override.conf` file only contains customizations, not the original defaults. Users who are accustomed to editing an existing set of defaults must refer to the (read-only) service unit side-by-side when editing the drop-in unit or use a command like `systemctl edit jenkins --full`, which copies the original service unit instead of creating a drop-in unit. Editing the drop-in unit with `systemctl edit jenkins` will automatically reload the `systemd(1)` configuration. The settings will take effect the next time Jenkins is restarted. If you edit the drop-in unit without `systemctl(1)`, you need to run `systemctl daemon-reload` for the changes to take effect. A final point to mention about the service unit is its use of specifiers, which may be unfamiliar to some users. The drop-in unit does not perform shell expansion. Specifiers can insert contextual information (like system hostname, unit name, and operating system kernel release) into the drop-in unit. The `systemd(1)` documentation contains link:https://www.freedesktop.org/software/systemd/man/systemd.unit.html#id-1.13.3[a table of specifiers available in unit files]. == Starting services Once the Jenkins `systemd` service has been defined, it can be started with: [source,bash] ---- # systemctl start jenkins ---- If Jenkins does not signal startup completion within a configured time, the service will be considered failed and | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/systemd-services.adoc | main | jenkins | [
-0.07440003752708435,
-0.010596555657684803,
0.02252863347530365,
-0.04422212392091751,
0.03015793114900589,
-0.041894204914569855,
-0.011747446842491627,
-0.038063544780015945,
0.03726271539926529,
0.010915564373135567,
-0.06546053290367126,
0.03255411610007286,
0.006168382242321968,
0.00... | 0.120216 |
contains link:https://www.freedesktop.org/software/systemd/man/systemd.unit.html#id-1.13.3[a table of specifiers available in unit files]. == Starting services Once the Jenkins `systemd` service has been defined, it can be started with: [source,bash] ---- # systemctl start jenkins ---- If Jenkins does not signal startup completion within a configured time, the service will be considered failed and will be shut down again. As each initialization milestone (i.e., "Started initialization", "Listed all plugins", "Prepared all plugins", "Started all plugins", "Augmented all extensions", "System config loaded", "System config adapted", "Loaded all jobs", "Configuration for all jobs updated", and "Completed initialization") is attained, the timeout is extended by the value of the `jenkins.model.Jenkins.extendTimeoutSeconds` system property (by default, 15 seconds). The timeout can be configured with the `TimeoutStartSec` directive in the service unit. == Stopping services The Jenkins `systemd` service can be stopped with: [source,bash] ---- # systemctl stop jenkins ---- == Restarting services The Jenkins `systemd` service can be restarted with: [source,bash] ---- # systemctl restart jenkins ---- == Reloading service definitions After changes to configuration files, the service definition may need to be reloaded with: [source,bash] ---- # systemctl daemon-reload ---- == Reading service logs Logs for the Jenkins service can be read with the command: [source,bash] ---- journalctl -u jenkins ---- == Pruning service logs Log files retained by `systemd` are commonly configured to automatically rotate. If the log files need to be reduced in size, use the command: [source,bash] ---- journalctl --vacuum-size=500M ---- == Viewing service status The Jenkins `systemd` service status can be viewed with `systemctl status jenkins`. Some examples are shown below. After upgrading plugins: [source,bash] ---- systemctl status jenkins ● jenkins.service - Jenkins Continuous Integration Server Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/jenkins.service.d └─override.conf Active: active (running) […] Main PID: […] (java) Status: "Restart in 10 seconds" ---- As Jenkins is being brought down: [source,bash] ---- systemctl status jenkins ● jenkins.service - Jenkins Continuous Integration Server Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/jenkins.service.d └─override.conf Active: deactivating (stop-sigterm) since […] Main PID: […] (java) Status: "Stopping Jenkins" ---- As Jenkins is starting up: [source,bash] ---- systemctl status jenkins ● jenkins.service - Jenkins Continuous Integration Server Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/jenkins.service.d └─override.conf Active: activating (start) since […] Main PID: […] (java) ---- After successful startup: [source,bash] ---- systemctl status jenkins ● jenkins.service - Jenkins Continuous Integration Server Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/jenkins.service.d └─override.conf Active: active (running) since […] Main PID: […] (java) ---- == Going further Some recommended readings on this subject: \* link:https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units[DigitalOcean systemd services and units tutorial] \* link:https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/[Understand and administering systemd] by the Fedora project \* link:https://www.freedesktop.org/wiki/Software/systemd/[systemd reference documentation] from freedesktop.org \* link:https://wiki.debian.org/systemd[Debian wiki: systemd] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/systemd-services.adoc | main | jenkins | [
-0.08696067333221436,
0.012338872067630291,
-0.01915132626891136,
-0.008849202655255795,
0.005920561496168375,
0.015907524153590202,
-0.06467432528734207,
0.008123989216983318,
0.04010391607880592,
-0.006582622416317463,
-0.05473955348134041,
0.039811089634895325,
0.03431275486946106,
0.00... | 0.140509 |
//// This file is only meant to be included as a snippet in other documents. It is used in reverse proxy document to describe the Jenkins context path. //// [#context-path] == Context path The context path is the prefix of a URL path. The Jenkins controller and the reverse proxy \*must use the same context path\*. For example, if the Jenkins controller URL is \https://www.example.com/jenkins/ then the `--prefix=/jenkins` argument must be included in the Jenkins controller command line arguments. Set the context path when using the Linux packages by running `systemctl edit jenkins` and adding the following: [source] ---- [Service] Environment="JENKINS\_PREFIX=/jenkins" ---- Set the context path on Windows controllers by including the `--prefix` command line argument in the `jenkins.xml` file in the installation directory. Ensure that Jenkins is running at the context path where your reverse proxy is serving Jenkins. You will have the least pain if you keep to this principle. The `--prefix` command line argument is not needed if the context path is empty. For example, the URL \https://jenkins.example.com/ has an empty context path. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/_partials/_context_path.adoc | main | jenkins | [
-0.06643233448266983,
0.003457422135397792,
-0.020854853093624115,
-0.043897829949855804,
-0.03806031122803688,
-0.049352679401636124,
-0.0072035049088299274,
0.016080103814601898,
0.06364509463310242,
0.0383971743285656,
-0.03815959021449089,
-0.03607642278075218,
-0.004661028739064932,
0... | 0.014845 |
[#running-jenkins-behind-lighttpd] = Reverse proxy - Lighttpd In situations where you have existing web sites on your server, you may find it useful to run Jenkins (or the servlet container that Jenkins runs in) behind https://www.lighttpd.net/[Lighttpd]. This allows you to bind Jenkins to the part of a bigger website that you may have or centralize the TLS termination in a single place. This section discusses some of the approaches for doing this. The link:https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod\_proxy[mod\_proxy] works by making Lighttpd perform as a "reverse proxy". This means when a request arrives for certain URLs, Lighttpd becomes a proxy and forwards that request to Jenkins, then forwards the response from Jenkins back to the client. There are two alternatives to configure Jenkins with Lighttpd. Select the technique that best meets your needs: \* xref:#by-host[By host] \* xref:#by-path[By path] By link:https://www.lighttpd.net/2018/11/28/1.4.52/[default], Lighttpd will force the URL normalization, thus mismatching the headers used by an internal Jenkins reverse proxy test. This results in showing the message \*It appears that your reverse proxy setup is broken\* on the manage page. To avoid this, explicit disable the option `url-path-2f-decode`. [#by-host] == By host In the configuration below there is no context path for Jenkins URL. When a request for the domain `jenkins.example.com` arrives, Lighttpd proxies this request to Jenkins. [source] ---- server.http-parseopts = ( "url-path-2f-decode" => "disable" ) server.modules += ( "mod\_proxy" ) $HTTP["host"] == "jenkins.example.com" { proxy.balance = "hash" proxy.server = ( "" => ( "jenkins" => ( "host" => "127.0.0.1", "port" => "8080" ) ) ) } ---- This assumes that you run Jenkins on port 8080. [#by-path] == By path In the configuration below there is a specific path `/jenkins` for Jenkins. This path should be configured in Lighttpd with `$HTTP["url"]`. In Jenkins, set the context path by modifying the jenkins.xml configuration file and adding `--prefix=/jenkins` (or similar) to the entry. When a request is made to, for example `http://localhost/jenkins`, Lighttpd proxies this request to Jenkins. [source] ---- server.http-parseopts = ( "url-path-2f-decode" => "disable" ) server.modules += ( "mod\_proxy" ) $HTTP["url"] =~ "^/jenkins(.\*)$" { proxy.balance = "hash" proxy.server = ( "" => ( "jenkins" => ( "host" => "127.0.0.1", "port" => 8080 ) ) ) } ---- This assumes that you run Jenkins on port 8080. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-lighttpd.adoc | main | jenkins | [
-0.05380138382315636,
0.01149112917482853,
0.023875655606389046,
0.0214976966381073,
-0.033942099660634995,
-0.1150103360414505,
-0.056813158094882965,
-0.017165588214993477,
0.01990770734846592,
-0.025550929829478264,
-0.014519179239869118,
0.06359655410051346,
-0.006586490198969841,
-0.0... | 0.007405 |
:page-aliases: user-docs:system-administration:reverse-proxy-configuration-nginx.adoc = Reverse proxy - Nginx In situations where you have existing web sites on your server, you may find it useful to run Jenkins (or the servlet container that Jenkins runs in) behind https://nginx.org/[Nginx], so that you can bind Jenkins to the part of a bigger website that you may have. This section discusses some of the approaches for doing this. When a request arrives for certain URLs, Nginx becomes a proxy and forwards that request to Jenkins, then it forwards the response back to the client. This 9 minute video tutorial from Darin Pope configures Nginx as a reverse proxy. .Configuring Nginx as a reverse proxy video::yixMeJGtLFk[youtube, width=640, height=360] The Nginx configuration fragment below provides an example Nginx reverse proxy configuration. It assumes the Jenkins controller and the Nginx reverse proxy are running on the same computer. [source] ---- upstream jenkins { keepalive 32; # keepalive connections server 127.0.0.1:8080; # jenkins ip and port } # Required for Jenkins websocket agents map $http\_upgrade $connection\_upgrade { default upgrade; '' close; } server { listen 80; # Listen on port 80 for IPv4 requests server\_name jenkins.example.com; # replace 'jenkins.example.com' with your server domain name # this is the jenkins web root directory # (mentioned in the output of "systemctl cat jenkins") root /var/run/jenkins/war/; access\_log /var/log/nginx/jenkins.access.log; error\_log /var/log/nginx/jenkins.error.log; # pass through headers from Jenkins that Nginx considers invalid ignore\_invalid\_headers off; location ~ "^/static/[0-9a-fA-F]{8}\/(.\*)$" { # rewrite all static files into requests to the root # E.g /static/12345678/css/something.css will become /css/something.css rewrite "^/static/[0-9a-fA-F]{8}\/(.\*)" /$1 last; } location /userContent { # have nginx handle all the static requests to userContent folder # note : This is the $JENKINS\_HOME dir root /var/lib/jenkins/; if (!-f $request\_filename){ # this file does not exist, might be a directory or a /\*\*view\*\* url rewrite (.\*) /$1 last; break; } sendfile on; } location / { sendfile off; proxy\_pass http://jenkins; proxy\_redirect default; proxy\_http\_version 1.1; # Required for Jenkins websocket agents proxy\_set\_header Connection $connection\_upgrade; proxy\_set\_header Upgrade $http\_upgrade; proxy\_set\_header Host $http\_host; proxy\_set\_header X-Real-IP $remote\_addr; proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for; proxy\_set\_header X-Forwarded-Proto $scheme; proxy\_max\_temp\_file\_size 0; #this is the maximum upload size client\_max\_body\_size 10m; client\_body\_buffer\_size 128k; proxy\_connect\_timeout 90; proxy\_send\_timeout 90; proxy\_read\_timeout 90; proxy\_request\_buffering off; # Required for HTTP CLI commands } } ---- This assumes that you run Jenkins on port 8080. Remember to create the folder /var/log/nginx/jenkins. include::partial$\_context\_path.adoc[] If you are having problems with some paths (eg folders) with \*Blue Ocean\*, you may need to add the following snippet to your proxy configuration: [source] ---- if ($request\_uri ~\* "/blue(/.\*)") { proxy\_pass http://YOUR\_SERVER\_IP:YOUR\_JENKINS\_PORT/blue$1; break; } ---- == Permissions To give Nginx permission to read Jenkins web root folder, add the `nginx` user to the Jenkins group: [source,sh] ---- usermod -aG jenkins nginx ---- If the last command failed because the `nginx` user is not defined in the system, then you can try adding the `www-data` user to the Jenkins group: [source,sh] ---- usermod -aG jenkins www-data ---- If you are experiencing timeouts when attempting to run long CLI commands through a proxy in Jenkins, you can increase the `+proxy\_read\_timeout+` setting as necessary. Older versions of Jenkins may not respect the `+proxy\_read\_timeout+` setting. If you are experiencing the following error when attempting to run long CLI commands in Jenkins and Jenkins is running behind Nginx, it is probably due to Nginx timing out the CLI connection. You can increase the `+proxy\_read\_timeout+` setting as necessary so the command will complete successfully. [source] ---- WARNING: null hudson.cli.DiagnosedStreamCorruptionException Read back: 0x00 0x00 0x00 0x1e 0x07 'Started reverse-proxy-test #68' 0x00 0x00 0x00 0x01 0x07 0x0a Read ahead: Diagnosis problem: java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565) ... at hudson.cli.FlightRecorderInputStream.analyzeCrash(FlightRecorderInputStream.java:82) at hudson.cli.PlainCLIProtocol$EitherSide$Reader.run(PlainCLIProtocol.java:153) | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-nginx.adoc | main | jenkins | [
-0.0782587081193924,
-0.009532742202281952,
-0.009725488722324371,
-0.020915940403938293,
-0.08075018227100372,
-0.07881861925125122,
-0.017661726102232933,
-0.0055080889724195,
0.040789663791656494,
-0.02592899464070797,
-0.08737930655479431,
0.05461546778678894,
0.00515887513756752,
-0.0... | 0.095057 |
connection. You can increase the `+proxy\_read\_timeout+` setting as necessary so the command will complete successfully. [source] ---- WARNING: null hudson.cli.DiagnosedStreamCorruptionException Read back: 0x00 0x00 0x00 0x1e 0x07 'Started reverse-proxy-test #68' 0x00 0x00 0x00 0x01 0x07 0x0a Read ahead: Diagnosis problem: java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565) ... at hudson.cli.FlightRecorderInputStream.analyzeCrash(FlightRecorderInputStream.java:82) at hudson.cli.PlainCLIProtocol$EitherSide$Reader.run(PlainCLIProtocol.java:153) Caused by: java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565) ... at java.io.DataInputStream.readInt(DataInputStream.java:387) at hudson.cli.PlainCLIProtocol$EitherSide$Reader.run(PlainCLIProtocol.java:111) ---- | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-nginx.adoc | main | jenkins | [
0.016687504947185516,
0.010240240953862667,
0.008240166120231152,
-0.026852086186408997,
-0.071834035217762,
-0.05277079716324806,
-0.09250447154045105,
-0.06297242641448975,
-0.03643295541405678,
0.020523857325315475,
-0.04776015505194664,
0.029652968049049377,
-0.1203312948346138,
-0.035... | -0.06636 |
= Reverse proxy - Pomerium You can secure your Jenkins application with JWT authentication and custom claims behind link:https://pomerium.com[Pomerium proxy]. == Why use Pomerium with Jenkins? You can set up role-based permissions in Jenkins to control a user’s privileges with Jenkins’ built-in authorization matrix. However, this method requires a username and password to sign in and relies on Jenkins’ user database to store credentials. JWT authentication is a more secure method of identity verification that authenticates and authorizes users against an identity provider, eliminating the need to store or share credentials to access your Jenkins application. However, Jenkins doesn’t support JWT authentication out of the box. With Pomerium, you can implement JWT authentication and apply claims to your route’s authorization policy to determine a user’s role and privileges before granting a user access to Jenkins. Once you’ve configured JWT authentication, you can assign permissions within Jenkins for a specific user, any authenticated user, anonymous users, or a user group. == Secure Jenkins with Pomerium proxy Please refer to Pomerium's link:https://www.pomerium.com/docs/guides/jenkins[guide on securing Jenkins]. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-pomerium.adoc | main | jenkins | [
-0.06410923600196838,
0.039198171347379684,
-0.011932147666811943,
-0.017702465876936913,
-0.05984553322196007,
-0.06813043355941772,
0.020487960427999496,
-0.01589576154947281,
0.006450035609304905,
-0.09091798961162567,
-0.08543749153614044,
-0.0011334643932059407,
0.011756760999560356,
... | -0.007625 |
= Reverse proxy - IIS In situations where you have existing web sites on your server, you may find it useful to run Jenkins (or the servlet container that Jenkins runs in) behind IIS, so that you can bind Jenkins to the part of a bigger website that you may have. This section discusses some of the approaches for doing this. \*Make sure that you change the Jenkins httpListenAddress from its default of 0.0.0.0 to 127.0.0.1 or configure the firewall to block request on the port Jenkins is bound to, otherwise any IIS-level restrictions can be easily bypassed by accessing the Jenkins port directly.\* == Requirements \* IIS 7.0 or greater. \*\* IIS 8.5 or greater if you want https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-85/certificate-rebind-in-iis85[Certificate Rebind]. \* https://www.iis.net/downloads/microsoft/url-rewrite[URL Rewrite 2.1] or greater. \*\* As the https://blogs.iis.net/iisteam/url-rewrite-v2-1[announcement] explains, it introduces a feature flag to turn off the default non-compliant-RFC3986 behavior. Which is what we want. \* https://www.iis.net/downloads/microsoft/application-request-routing[Application Request Routing] 3.0 or greater. \* Server access == Example use case I have a dedicated Jenkins installation on a Windows Server 2012 R2 server with a Common Name of \*VRTJENKINS01\* in the Active Directory domain \*acme.example\* and is reachable by the Fully Qualified Domain Name \*vrtjenkins01.acme.example\*. Additionally Jenkins runs on port \*8080\* and already listens to \*127.0.0.1\* instead of 0.0.0.0 and the server has additional DNS names: \*jenkins\* and \*jenkins.acme.example\*. I want to have an IIS installation which acts as a TLS/SSL terminating reverse proxy. In combination with our in-house Active Directory Certificate Services (ADCS, Microsoft's Certificate Authority software) this should make certificate management a lot easier since Windows can be configured to automatically renew certificates, and the IIS 8.5+ Certificate Rebind feature can listen to renewal events (which contain the fingerprints of both the old and new certificate) and update the relevant bind(s) to use the fresh certificate. This would ensure that after the initial manual request it would only be necessary to manually change TLS/SSL related settings when the set of Alternate Subject Names on the certificate IIS presents should change. IIS will only have to act as 1) a reverse proxy for Jenkins 2) redirect non-canonical URLs to the canonical URL: \_\https://jenkins.acme.example/\_ I have installed the IIS (8.5) role using the \_Add Roles and Features Wizard\_ with the all the default and also the following non-default features: \* HTTP Redirection (Under \_Common HTTP Features\_, to redirect \http(s)://jenkins/, etc. to https://jenkins.acme.example/) \* WebSocket Protocol (Under \_Application Development\_, because I felt like it) Then I installed URL Rewrite and Application Request Routing. == Configuration Time === Enabling Reverse Proxy functionality . In the \_Internet Information Services (IIS) Manager\_ click on the VRTJENKINS01 server. . Go to \_Application Request Routing Cache\_. . In the \_Actions\_ panel click on \_Server Proxy Settings...\_ . Enable the proxy . Disable the \_Reverse rewrite host in response header\_ .. Don't worry, it will work, just follow the rest of the instructions . Set the \_Response buffer threshold (KB)\_ to 0. .. This helps to prevent HTTP 502 errors on Jenkins' Replay pages. . Apply (the \_Actions\_ panel again) === Configuring TLS/SSL Out of scope, there are enough tutorials on the rest of the interwebs for this part. The rest of this tutorial will assume it has been configured with a certificate trusted by your browser of choice. === Configuring rules for response rewriting . Go to the \_Default Web Site\_ . Go to \_\_URL Rewrite\_\_ . In the \_Actions\_ panel click \_View Server Variables...\_ . Add the following is not already define on the server level: .. Name: \*HTTP\_FORWARDED\* . Click on \_Back to Rules\_ . \_Click on Add Rule(s)...\_ . Select | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iis.adoc | main | jenkins | [
-0.03236507251858711,
0.02682611346244812,
-0.024292508140206337,
0.02268509939312935,
-0.0557883158326149,
-0.08910734206438065,
-0.05921342223882675,
-0.020134147256612778,
-0.012805537320673466,
-0.0025880029425024986,
-0.069497250020504,
-0.02617904543876648,
0.03648558631539345,
0.024... | 0.053407 |
rewriting . Go to the \_Default Web Site\_ . Go to \_\_URL Rewrite\_\_ . In the \_Actions\_ panel click \_View Server Variables...\_ . Add the following is not already define on the server level: .. Name: \*HTTP\_FORWARDED\* . Click on \_Back to Rules\_ . \_Click on Add Rule(s)...\_ . Select \_Reverse Proxy\_ and click on OK . Enter \_jenkins.acme.example\_ and click on OK . Open the rule you just created . Under \_Conditions\_ add: .. Condition input: \*\{CACHE\_URL}\* .. Pattern: \*^(http|ws)s://\* . Under \_Server Variables\_ add: .. Name: \*HTTP\_FORWARDED\*, Value: \*for=\{REMOTE\_ADDR};by=\{LOCAL\_ADDR};host="\{HTTP\_HOST}";proto="https"\*, Replace: yes ... Jenkins runs under Jetty, Jetty supports https://tools.ietf.org/html/rfc7239[RFC7239], so all should be well. . Under Action change: .. Rewrite URL to \*\{C:1}\://jenkins.acme.example:8080\{UNENCODED\_URL}\* ... Note that there is no slash between the port number and the opening curly bracket .. \*Remove\* the check from the \*Append query string\* checkbox . Apply the changes. . Edit \_C:\Windows\System32\drivers\etc\hosts\_ so that \*jenkins.acme.example\* points to 127.0.0.1 .. When resolving names Windows will check if the name is its own name before consulting the hosts file. Meaning that adding \_vrtjenkins01\_ or \_vrtjenkins01.acme.example\_ to the hosts file won't have any effect. ... The hosts file will however be consulted before consulting the DNS infrastructure === Experiencing the dreaded "It appears that your reverse proxy set up is broken." error for yourself . \https://jenkins.acme.example/configure . Configure the \_Jenkins URL\_ to be \*\*\https://jenkins.acme.example/\*\* and save the change . Go to \_Security\_ and enable \_Enable proxy compatibility\_ if you have already enabled \_Prevent Cross Site Request Forgery exploits\_ . Go to \https://jenkins.acme.example/manage . You will still experience the "It appears that your reverse proxy set up is broken." as expected .. If you do not get that at this point, then that is very weird... Continue anyway. . Right click the \_System\_ link and choose to inspect the element. .. Make sure you are still on the Manage page as you will want it as your referrer . Change the value of the \_href\_ attribute to be \_administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test\_ . Open the link you just changed in a new tab. .. Keep this tab open . Observe the "\https://jenkins.acme.example/manage vs http:" error and bask in its glory .. a white page served with HTTP status code is 200 indicates all is well ... If you do get that at this point, then that is very weird... Continue anyway. === Fixing the errors . In IIS Manager got to \_Application Pools\_ then edit \_DefaultAppPool\_ so that the \_.NET CLR version\_ is \*No Managed Code\* .. You might find that this is not necessary (at far as you can tell) for your setup, since IIS will only act as a TLS/SSL offloading reverse proxy, we don't need it. . Then go to \_Sites\_ → \_Default Web Site\_ → \_Request Filtering\_ and in the \_Actions\_ panel choose \_Edit Feature Settings...\_ and turn on \*Allow double escaping\* .. This is so IIS forwards URLs like \https://jenkins.acme.example/%2525 to Jenkins instead of showing an IIS error page . Last, but not least, go to \_Sites\_ → \_Default Web Site\_ → \_\_Configuration Editor\_\_ and change the \_Section\_ to \_system.webServer/rewrite/rules\_ . Now you should see the URL Rewrite 2.1 property \_useOriginalURLEncoding\_ listed, if not install URL Rewrite 2.1 using the x86 or x64 installer, not the WebPI one and resume from here after a reboot. . Change \_useOriginalURLEncoding\_ to \*False\* .. As the URL Rewrite 2.1 announcement this will change the value of \{UNENCODED\_URL} to make it \_RFC3986\_ and usable for reverse proxy forwarding purposes .. original as in pre 2.1 behaviour. . Refresh that tab you were supposed to keep open, or recreate it. .. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iis.adoc | main | jenkins | [
-0.0040985154919326305,
0.047897059470415115,
0.03742823749780655,
0.03125210851430893,
-0.0667153000831604,
-0.0972907543182373,
-0.040786098688840866,
-0.043330732733011246,
-0.015587731264531612,
0.09132754802703857,
-0.05234699323773384,
-0.02836763858795166,
0.008301764726638794,
-0.0... | -0.012067 |
Change \_useOriginalURLEncoding\_ to \*False\* .. As the URL Rewrite 2.1 announcement this will change the value of \{UNENCODED\_URL} to make it \_RFC3986\_ and usable for reverse proxy forwarding purposes .. original as in pre 2.1 behaviour. . Refresh that tab you were supposed to keep open, or recreate it. .. Again, take some time to bask in its glory . It should now be white, also the Manage page should no longer complain! === Continue configuring IIS Some of the things you might want but I won't cover: \* \_Hypertext Strict Transport Security\_ headers \* Redirecting from non canonical URLs to the canonical URL (ok, sort of covered this in the web.config example) \* The X-UA-Compatibility header so that Internet Explorer 11 (or 9, or ...) won't claim to be IE 7 for intranet sites \* Use IIS Crypto to configure cipher suites \* ... === A working web.config \*web.config\* [source,xml] ---- xml version="1.0" encoding="UTF-8"? ---- | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iis.adoc | main | jenkins | [
-0.005990208592265844,
0.018997788429260254,
0.07979210466146469,
0.02613258920609951,
-0.038104310631752014,
-0.05997622013092041,
0.013245359994471073,
-0.07581421732902527,
-0.04864555597305298,
0.05392557755112648,
-0.04962170124053955,
0.014951544813811779,
0.016389664262533188,
0.018... | 0.015959 |
:page-aliases: user-docs:system-administration:reverse-proxy-configuration-apache.adoc [#running-jenkins-behind-apache] = Reverse proxy - Apache In situations where you have existing web sites on your server, you may find it useful to run Jenkins (or the servlet container that Jenkins runs in) behind Apache, so that you can bind Jenkins to the part of a bigger website that you may have. This section discusses some of the approaches for doing this. \*Make sure that you change the Jenkins httpListenAddress from its default of 0.0.0.0 to 127.0.0.1 or any Apache-level restrictions can be easily bypassed by accessing the Jenkins port directly.\* There are several different alternatives to configure Jenkins with Apache. Choose the technique that best meets your needs: \* <> \* <> \* <> This 6 minute tutorial from Darin Pope configures Apache httpd on Alma Linux as a reverse proxy with <>. .Configure Apache HTTP server as a reverse proxy video::E3\_g5wYZlfk[youtube, width=640, height=360] [#mod\_proxy] == mod\_proxy http://httpd.apache.org/docs/2.0/mod/mod\_proxy.html[mod\_proxy] works by making Apache perform "reverse proxy" — when a request arrives for certain URLs, Apache becomes a proxy and forwards that request to Jenkins, then forwards the response from Jenkins back to the client. The following Apache modules must be installed : [source] ---- a2enmod proxy a2enmod proxy\_http a2enmod headers ---- A typical setup for mod\_proxy would look like this: [source] ---- ProxyPass /jenkins http://localhost:8081/jenkins nocanon ProxyPassReverse /jenkins http://localhost:8081/jenkins ProxyRequests Off AllowEncodedSlashes NoDecode # Local reverse proxy authorization override # Most unix distribution deny proxy by default # See /etc/apache2/mods-enabled/proxy.conf in Ubuntu Order deny,allow Allow from all ---- This assumes that you run Jenkins on port 8081. <> provides more details on reverse proxy requires for the Jenkins context path. When running on a dedicated server and you are using / as context, make sure you add a slash at the end of all URLs in proxy params in apache. Otherwise you might run into proxy errors. So [source] ---- ProxyPass / http://localhost:8080/ nocanon ---- instead of [source] ---- ProxyPass / http://localhost:8080 nocanon # wont work ---- Note that this does \*not\* apply to the `+ProxyPassMatch+` directive, which behaves differently than `+ProxyPass+`. Below is an example of `+ProxyPassMatch+` to proxy all URLs other than `+/.well-known+` (a URL required by letsencrypt): [source] ---- ProxyPassMatch ^/(?\!.well-known) http://localhost:8080 nocanon ---- The \_ProxyRequests Off\_ prevents Apache from functioning as a forward proxy server (except for \_ProxyPass\_), it is advised to include it unless the server should function as a proxy. Both the `+nocanon+` option to `+ProxyPass+`, \_and\_ `+AllowEncodedSlashes NoDecode+`, are required for certain Jenkins features to work. If you are running Apache on a Security-Enhanced Linux (SE-Linux) machine it is essential to make SE-Linux do the right thing by issuing as root [source] ---- setsebool -P httpd\_can\_network\_connect true ---- If this is not issued Apache will not be allowed to forward proxy requests to Jenkins and only an error message will be displayed. Because Jenkins already compress its output, you can not use the normal proxy-html filter to modify urls: [source] ---- SetOutputFilter proxy-html ---- Instead, you can use the following: [source] ---- SetOutputFilter INFLATE;proxy-html;DEFLATE ProxyHTMLURLMap http://your\_server:8080/jenkins /jenkins ---- But since Jenkins seems to be well behaved it's even better to just not use SetOutputFilter and ProxyHTMLURLMap. If there are problems with Jenkins sometimes servicing random garbage pages, then the following may help: [source] ---- SetEnv proxy-nokeepalive 1 ---- Some plug-ins determine URLs from client requests from Host header, so if you experience some problems with wrong URLs, you can try to switch on `+ProxyPreserveHost+` directive, which is switched off by default: [source] ---- ProxyPreserveHost On ---- === mod\_proxy with HTTPS You can add an additional `+ProxyPassReverse+` directive to redirect non-SSL URLs | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-apache.adoc | main | jenkins | [
-0.027195142582058907,
0.0016239460092037916,
-0.0003028156061191112,
-0.046943604946136475,
-0.06546081602573395,
-0.08200541138648987,
-0.09519898891448975,
-0.01231144368648529,
-0.02961544133722782,
-0.0009908638894557953,
-0.030569694936275482,
0.010850232094526291,
0.00954565592110157,... | 0.039421 |
URLs from client requests from Host header, so if you experience some problems with wrong URLs, you can try to switch on `+ProxyPreserveHost+` directive, which is switched off by default: [source] ---- ProxyPreserveHost On ---- === mod\_proxy with HTTPS You can add an additional `+ProxyPassReverse+` directive to redirect non-SSL URLs generated by Jenkins to the SSL side. Assuming that your webserver is `+your.host.com+`, placing the following within the SSL virtual host definition will do the trick: [source] ---- ProxyRequests Off ProxyPreserveHost On AllowEncodedSlashes NoDecode Order deny,allow Allow from all ProxyPass /jenkins http://localhost:8081/jenkins nocanon ProxyPassReverse /jenkins http://localhost:8081/jenkins ProxyPassReverse /jenkins http://your.host.com/jenkins ---- Yet another option is to rewrite the Location headers that contain non-ssl URL's generated by Jenkins. If you want to access Jenkins from \https://www.example.com/jenkins, placing the following within the SSL virtual host definition also works: [source] ---- ProxyRequests Off ProxyPreserveHost On ProxyPass /jenkins/ http://localhost:8081/jenkins/ nocanon AllowEncodedSlashes NoDecode ProxyPassReverse / Order deny,allow Allow from all Header edit Location ^http://www.example.com/jenkins/ https://www.example.com/jenkins/ ---- But it may also work fine to just use simple forwarding as above (the first HTTPS snippet), and add [source] ---- RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port "443" ---- in the HTTPS site configuration, as the Docker demo (below) does. (`+X-Forwarded-Port+` is not interpreted by Jenkins prior to https://issues.jenkins.io/browse/JENKINS-23294[JENKINS-23294] so it may also be desirable to configure the servlet container to specify the originating port.) [source] ---- NameVirtualHost \*:80 NameVirtualHost \*:443 ServerAdmin webmaster@localhost Redirect permanent / https://www.example.com/ SSLEngine on SSLCertificateFile /etc/ssl/certs/cert.pem ServerAdmin webmaster@localhost ProxyRequests Off ProxyPreserveHost On AllowEncodedSlashes NoDecode Order deny,allow Allow from all ProxyPass / http://localhost:8080/ nocanon ProxyPassReverse / http://localhost:8080/ ProxyPassReverse / http://www.example.com/ RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port "443" ---- [#mod\_rewrite] == mod\_rewrite The Apache mod\_rewrite module can be used to configure an Apache reverse proxy for Jenkins. The following Apache modules must be installed : [source] ---- a2enmod rewrite a2enmod proxy a2enmod proxy\_http ---- A typical mod\_rewrite configuration would look like this: [source] ---- # Use last flag because no more rewrite can be applied after proxy pass # NE makes sure slashes are not re-encoded. # Apache does not re-encode spaces though, we ask Apache to encode it again with the B flag # BNP tells apache to use %20 instead of + to re-encode the space RewriteRule ^/jenkins(.\*)$ http://localhost:8081/jenkins$1 [P,L,NE,B=\,BNP] ProxyPassReverse /jenkins http://localhost:8081/jenkins ProxyRequests Off AllowEncodedSlashes NoDecode # Local reverse proxy authorization override # Most unix distribution deny proxy by default # See /etc/apache2/mods-enabled/proxy.conf in Ubuntu Order deny,allow Allow from all # If using HTTPS, add the following directives # RequestHeader set X-Forwarded-Proto "https" # RequestHeader set X-Forwarded-Port "443" ---- This assumes that you run Jenkins on port 8081. The context path of Jenkins must be the same between Apache and Jenkins. Jenkins can't run on \http://example.com:8081/ci and be reverse proxied at \http://example.com/jenkins . <> provides more details on reverse proxy requires for the Jenkins context path. The \_ProxyRequests Off\_ prevents Apache from functioning as a forward proxy server (except for \_ProxyPass\_), it is advised to include it unless the server should function as a proxy. include::partial$\_context\_path.adoc[] == Proxying CLI commands with the HTTP(S) transport Using the plain CLI protocol with the HTTP(S) transport to access Jenkins through an Apache reverse proxy does not work. See https://issues.jenkins.io/browse/JENKINS-47279[JENKINS-47279 - Full-duplex HTTP(S) transport with plain CLI protocol does not work with Apache reverse proxy] for more details. As a workaround, you can use the xref:user-docs:managing:cli.adoc#ssh[CLI over SSH]. If using Apache check that \_nocanon\_ is set on \_ProxyPass\_ and that \_AllowEncodedSlashes\_ is set. \_AllowEncodedSlashes\_ is not inherited in Apache configs, so this directive must be placed inside the \_VirtualHost\_ definition. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-apache.adoc | main | jenkins | [
-0.030530700460076332,
0.06627538055181503,
0.03997974470257759,
0.043099451810121536,
-0.0428401455283165,
-0.06388285011053085,
-0.08173166960477829,
-0.09089384973049164,
0.05544530972838402,
-0.0031994774471968412,
-0.09064017981290817,
-0.051828812807798386,
0.06019746512174606,
0.038... | -0.053986 |
more details. As a workaround, you can use the xref:user-docs:managing:cli.adoc#ssh[CLI over SSH]. If using Apache check that \_nocanon\_ is set on \_ProxyPass\_ and that \_AllowEncodedSlashes\_ is set. \_AllowEncodedSlashes\_ is not inherited in Apache configs, so this directive must be placed inside the \_VirtualHost\_ definition. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-apache.adoc | main | jenkins | [
0.0551784485578537,
-0.04090502858161926,
-0.042385756969451904,
-0.09642722457647324,
-0.046794503927230835,
-0.04128814861178398,
-0.030717898160219193,
-0.07750072330236435,
-0.008535252884030342,
-0.0013696531532332301,
0.07232454419136047,
-0.06290723383426666,
0.0119886863976717,
0.0... | -0.085934 |
:page-aliases: user-docs:system-administration:reverse-proxy-configuration-squid.adoc = Reverse proxy - Squid In situations where you want a user friendly url to access Jenkins (Not port 8080), it may make sense run Jenkins behind Squid, so that you can access Jenkins on port 80 or 443. This section discusses some of the approaches for doing this. == Squid 2.6 Using Squid 2.6: [source] ---- acl all src 0.0.0.0/0.0.0.0 acl localhost src 127.0.0.1/255.255.255.255 acl manager proto cache\_object acl to\_localhost dst 127.0.0.0/8 acl valid\_dst dstdomain .YOUR\_DOMAIN ci cache\_replacement\_policy heap LFUDA memory\_replacement\_policy heap GDSF cache\_dir ufs /var/spool/squid 512 16 256 cache\_mem 512 MB maximum\_object\_size 12000 KB ## http --> https redirect ## don't forget to update "Jenkins URL" on https://ci.YOUR\_DOMAIN/configure #acl httpPort myport 80 #http\_access deny httpPort #deny\_info https://ci.YOUR\_DOMAIN/ httpPort cache\_peer localhost parent 8080 0 originserver name=myAccel coredump\_dir /var/spool/squid hierarchy\_stoplist cgi-bin http\_access allow localhost http\_access allow manager localhost http\_access allow valid\_dst http\_access deny all http\_access deny manager ## mkdir /etc/squid/ssl/ && cd /etc/squid/ssl/ ## to generate your self-signed certificate ## openssl genrsa -out jenkins.key 1024 ## openssl req -new -key jenkins.key -x509 -out jenkins.crt -days 999 http\_port 80 vhost #https\_port 443 cert=/etc/squid/ssl/jenkins.crt key=/etc/squid/ssl/jenkins.key vhost http\_reply\_access allow all icp\_access allow all refresh\_pattern -i \.jp(e?g|gif|png|ico) 300 20% 600 override-expire # Combine following THREE LINES into a SINGLE LINE for Squid logformat combined %>a %ui %un \[%tl\] "%rm %ru HTTP/%rv" %Hs %h" "%{User-Agent}>h" %Ss:%Sh strip\_query\_terms off access\_log /var/log/squid/access.log combined visible\_hostname ci.YOUR\_DOMAIN ---- This assumes that you run Jenkins on localhost port 8080. But you can have it on an other server / different port (adjust line starting with cache\_peer) + Of course replace YOUR\_DOMAIN with your domain. + === With ssl Remove one level of comment [source] ---- sed s/^#// /etc/squid/squid.conf ---- Note: If you use the swarm client plugin, the nodes may report: [source] ---- Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:285) at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:191) at sun.security.validator.Validator.validate(Validator.java:218) at c.s.n.s.i.s.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126) at c.s.n.s.i.s.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209) at c.s.n.s.i.s.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249) at c.s.n.s.i.s.ClientHandshaker.serverCertificate(ClientHandshaker.java:1014) ... 13 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target ---- You may be able to avoid that message with the `-noCertificateCheck` argument to `agent.jar`. That will disable server certificate checking from the agent. include::user-docs:system-administration:partial$\_context\_path.adoc[] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-squid.adoc | main | jenkins | [
-0.1016431450843811,
0.04255649819970131,
-0.011839576065540314,
0.020015962421894073,
-0.06602603197097778,
-0.09505078196525574,
-0.016569102182984352,
-0.03856169432401657,
0.019239312037825584,
-0.013144776225090027,
-0.021660804748535156,
-0.0227900892496109,
-0.03188355267047882,
0.0... | -0.00035 |
:page-aliases: user-docs:system-administration:reverse-proxy-configuration-haproxy.adoc = Reverse proxy - HAProxy In situations where you want a user friendly URL, different public ports, or to terminate SSL connections before they reach Jenkins, you may find it useful to run Jenkins (or the servlet container that Jenkins runs in) behind HAProxy. This section discusses some of the approaches for doing this. This 6 minute video tutorial from Darin Pope configures an HAProxy reverse proxy. .Configuring an HAProxy reverse proxy video::TuTdvYfM8T8[youtube, width=640, height=360] == Plain HTTP Using HAProxy 2.6.7, here is an example HAProxy.cfg to proxy over plain HTTP: [source] ---- # If you already have an haproxy.cfg file, you can probably leave the # global and defaults section as-is, but you might need to increase the # timeouts so that long-running CLI commands will work. global maxconn 4096 log stdout local0 debug defaults log global option httplog option dontlognull option forwardfor maxconn 20 timeout connect 5s timeout client 60s timeout server 60s frontend http-in log stdout format raw local0 debug #for additional logging bind \*:80 mode http acl prefixed-with-jenkins path\_beg /jenkins # Use http-request redirect prefix to add /jenkins prefix to URL's location # to ensure jenkins base url (context path) is working properly. http-request redirect code 301 prefix /jenkins unless prefixed-with-jenkins use\_backend jenkins if prefixed-with-jenkins backend jenkins log stdout format raw local0 debug mode http server jenkins1 127.0.0.1:8080 check http-request replace-path /jenkins(/)?(.\*) /\2 http-request set-header X-Forwarded-Port %[dst\_port] http-request add-header X-Forwarded-Proto https if { ssl\_fc } http-request set-header X-Forwarded-Host %[req.hdr(Host)] ---- This assumes Jenkins is running locally on port 8080. This assumes that you are using the http://localhost/jenkins[/jenkins] context path for both the site exposed from HAProxy and Jenkins itself. If this is not the case, you will need to adjust the configuration. Refer to the HAProxy documentation on link:https://www.haproxy.com/documentation/hapee/latest/traffic-routing/[traffic routing] for more information. If you are experiencing the following error when attempting to run long CLI commands in Jenkins, and Jenkins is running behind HAProxy, it is probably due to HAProxy timing out the CLI connection. You can increase the `+timeout client+` and `+timeout server+` settings as necessary so the command will complete successfully. [source] ---- WARNING: null hudson.cli.DiagnosedStreamCorruptionException Read back: 0x00 0x00 0x00 0x1e 0x07 'Started reverse-proxy-test #68' 0x00 0x00 0x00 0x01 0x07 0x0a Read ahead: Diagnosis problem: java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565) ... at hudson.cli.FlightRecorderInputStream.analyzeCrash(FlightRecorderInputStream.java:82) at hudson.cli.PlainCLIProtocol$EitherSide$Reader.run(PlainCLIProtocol.java:153) Caused by: java.io.IOException: Premature EOF at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565) ... at java.io.DataInputStream.readInt(DataInputStream.java:387) at hudson.cli.PlainCLIProtocol$EitherSide$Reader.run(PlainCLIProtocol.java:111) ---- == With SSL Using HAProxy 2.6.7, here is an example HAProxy.cfg to connect to the proxy using SSL, terminate the SSL connection, and then talk to Jenkins using plain HTTP: [source] ---- # If you already have an haproxy.cfg file, you can probably leave the # global and defaults section as-is, but you might need to increase the # timeouts so that long-running CLI commands will work. global maxconn 4096 log stdout local0 debug defaults log global option httplog option dontlognull option forwardfor maxconn 20 timeout connect 5s timeout client 5m timeout server 5m frontend http-in log stdout format raw local0 debug bind \*:80 bind \*:443 ssl crt /usr/local/etc/haproxy/ssl/server.pem mode http acl prefixed-with-jenkins path\_beg /jenkins http-request redirect code 301 prefix /jenkins unless prefixed-with-jenkins redirect scheme https if !{ ssl\_fc } # Redirect http requests to https use\_backend jenkins if prefixed-with-jenkins backend jenkins log stdout format raw local0 debug mode http server jenkins1 127.0.0.1:8080 check http-request replace-path /jenkins(/)?(.\*) /\2 http-request set-header X-Forwarded-Port %[dst\_port] http-request add-header X-Forwarded-Proto https if { ssl\_fc } http-request set-header X-Forwarded-Host %[req.hdr(Host)] ---- include::user-docs:system-administration:partial$\_context\_path.adoc[] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-haproxy.adoc | main | jenkins | [
-0.05134165287017822,
0.011889822781085968,
-0.03265906870365143,
-0.029740890488028526,
-0.08962002396583557,
-0.04073920100927353,
-0.028820591047406197,
0.007210795767605305,
-0.03071465715765953,
-0.03767169266939163,
-0.07403503358364105,
0.015092323534190655,
-0.016065450385212898,
-... | -0.024489 |
127.0.0.1:8080 check http-request replace-path /jenkins(/)?(.\*) /\2 http-request set-header X-Forwarded-Port %[dst\_port] http-request add-header X-Forwarded-Proto https if { ssl\_fc } http-request set-header X-Forwarded-Host %[req.hdr(Host)] ---- include::user-docs:system-administration:partial$\_context\_path.adoc[] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-haproxy.adoc | main | jenkins | [
-0.019096000120043755,
0.049642737954854965,
0.007194220088422298,
-0.03461171314120293,
-0.02806381694972515,
-0.10065795481204987,
-0.0951317697763443,
-0.055746931582689285,
0.038012903183698654,
-0.004442483186721802,
-0.04685547575354576,
-0.053456783294677734,
-0.026826050132513046,
... | -0.055343 |
:page-aliases: user-docs:system-administration:reverse-proxy-configuration-iptables.adoc = Reverse proxy - iptables The default Jenkins installation runs on ports 8080 and 8443. Typically, HTTP/HTTPS servers run on ports 80 and 443, respectively. But these ports are considered privileged on Unix/Linux systems, and the process using them must be owned by root. Running Jenkins as root is not recommended - it should be run as its own user. One solution is to front Jenkins with a web server such as Apache, and let it proxy requests to Jenkins, but this requires maintaining the Apache installation as well. In situations where you are wanting to run Jenkins on port 80 or 443 (i.e. HTTP/HTTPS), but you do not want to setup a proxy server you can use \_iptables\_ on Linux to forward traffic. == Ubuntu Installations Follow the xref:installing-jenkins:linux.adoc#debianubuntu[Ubuntu installation instructions] to install and configure the initial Jenkins installation on a supported version of Ubuntu. These instructions are known to not work on Ubuntu versions that are no longer supported by the Ubuntu project. == Prerequisites In order to forward traffic from 80/443 to 8080/8443, first you must ensure that iptables has allowed traffic on all 4 of these ports. Use the following command to list the current iptables configuration: [source] ---- iptables -L -n ---- You should see in the output entries for 80, 443, 8080, and 8443. Here is an example output for comparison. [source] ---- ain INPUT (policy ACCEPT)target prot opt source destination target prot opt source destination ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8443 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT) target prot opt source destination REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT) target prot opt source destination target prot opt source ---- If you dont see entries for these ports, then you need to run commands (as root or with sudo) to add those ports. For example, if you see none of these and need to add them all, you would need to issue the following commands: [source] ---- sudo iptables -I INPUT 1 -p tcp --dport 8443 -j ACCEPT sudo iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT sudo iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT ---- NOTE:: I used -I INPUT 1. In a lot of iptables documentation/examples, you will see -A INPUT. The difference is that -A appends to the list of rules, while -I INPUT 1 inserts before the first entry. Usually when adding new accept ports to iptables configuration, you want to put them at the beginning of the ruleset, not the end. Run iptables -L -n again and you should now see entries for these 4 ports. == Forwarding Once traffic on the required ports are allowed, you can run the command to forward port 80 traffic to 8080, and port 443 traffic to 8443. The commands look like this: [source] ---- sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443 ---- You can verify the forwarding rules using below command. [source] ---- [root@xyz~]# iptables -L -t nat Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- anywhere anywhere | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iptables.adoc | main | jenkins | [
-0.010309848934412003,
0.022938743233680725,
-0.023895777761936188,
-0.0839327797293663,
-0.08977954089641571,
-0.08903726935386658,
-0.04663528874516487,
0.007344203535467386,
0.013138306327164173,
0.008836002089083195,
-0.05533751845359802,
0.015725521370768547,
-0.006097937002778053,
-0... | -0.033785 |
REDIRECT --to-port 8080 sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443 ---- You can verify the forwarding rules using below command. [source] ---- [root@xyz~]# iptables -L -t nat Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8080 REDIRECT tcp -- anywhere anywhere tcp dpt:https redir ports 8443 Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination ---- + Once these rules are set and confirmed with iptables -L -n, and once your Jenkins instance is up and running on port 8080, attempt to access your Jenkins instance on port 80 instead of 8080. It should work and your URL should stay on port 80 - in other words, it should not get redirected to 8080. The fact that forwarding from 80 to 8080 (or 443 to 8443) should remain hidden from the client. === Saving iptables Configuration Using the iptables command to change port configuration and routing rules only changes the current, in-memory configuration. It does not persist between restarts of the iptables service. So, you need to make sure you save the configuration to make the changes permanent. Saving the configuration is slightly different between Red Hat rpm based and Debian-based systems. On Red Hat-based systems (Red Hat Enterprise Linux, Fedora, Alma Linux, Rocky Linux, Oracle Linux, CentOS, etc), issue the following command: [source] ---- sudo iptables-save > /etc/sysconfig/iptables ---- On a Debian-based system (Debian, Ubuntu, Mint, etc), issue the following command: [source] ---- sudo sh -c "iptables-save > /etc/iptables.rules" ---- The iptables-restore command will need to be executed manually, or your system configured to automatically run it on boot, against the /etc/iptables.rules file you have created, in order for your iptables configuration to be retained across reboots. On Ubuntu, the fastest way is to install `iptables-persistent` after configuring iptables. It will automatically create the required files from the current configuration and load them on boot. [source] ---- sudo apt-get install iptables-persistent ---- See https://help.ubuntu.com/community/IptablesHowTo for other Ubuntu options. There are many other resources describing this; please consult your system's documentation or search on the internet for information specific to your flavor of Linux. If you are unsure at all about what kind of system you have, consult that system's documentation on how to update iptables configuration. == Using firewalld Some Linux distributions (Red Hat Enterprise Linux, Rocky Linux, Alma Linux, Oracle Linux, CentOS, etc.) ship with firewalld which serves as a front-end for iptables. Configuration thru firewalld is done via the \*firewall-cmd\* command. Instead of using any of the iptables commands mentioned above, all you should need to do is something like: [source] ---- # allow incoming connections on port 80. # You can also use --add-service=http instead of adding a port number sudo firewall-cmd --add-port=80/tcp --permanent sudo firewall-cmd --permanent \ --add-forward-port=port=80:proto=tcp:toaddr=127.0.0.1:toport=8080 # allow incoming connections on port 443. # You can also use --add-service=https instead of adding a port number sudo firewall-cmd --add-port=443/tcp --permanen t sudo firewall-cmd --permanent \ --add-forward-port=port=443:proto=tcp:toaddr=127.0.0.1:toport=8443 sudo firewall-cmd --reload ---- With the above commands, jenkins can be configured to run on localhost:8080 and/or localhost:8443 (depending if you need or want to do SSL or not) firewalld will then create the required iptables rules so that incoming connections on port 80 are forwarded to jenkins on 8080 (and 443 is forwarded to 8443). | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iptables.adoc | main | jenkins | [
0.013205330818891525,
0.06770244985818863,
-0.010789409279823303,
-0.0663546621799469,
0.01559914369136095,
-0.0627114400267601,
0.017021408304572105,
-0.04025663062930107,
0.015061022713780403,
-0.010376261547207832,
-0.02671731263399124,
0.01319098100066185,
0.008907904848456383,
0.00729... | -0.067195 |
then create the required iptables rules so that incoming connections on port 80 are forwarded to jenkins on 8080 (and 443 is forwarded to 8443). | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iptables.adoc | main | jenkins | [
0.0012586995726451278,
0.0895250216126442,
-0.024568064138293266,
-0.0365070179104805,
-0.07098608464002609,
-0.08897988498210907,
-0.03619764372706413,
-0.0596219040453434,
-0.011955090798437595,
-0.010358952917158604,
-0.04050545021891594,
0.002360456855967641,
0.031692057847976685,
-0.0... | -0.03442 |
= Reverse proxy configuration [pass] ++++ (function () { var anchorMap = { "ji-toolbar" : "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/", /\* Algolia search redirect to stay on same page \*/ "running-jenkins-behind-apache": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-apache/", "running-jenkins-behind-haproxy": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-haproxy/", "running-jenkins-behind-iis": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iis/", "running-jenkins-behind-iptables": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iptables/", "running-jenkins-behind-nginx": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-nginx/", "running-jenkins-behind-squid": "/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-squid/", } /\* \* Best practice for extracting hashes: \* https://stackoverflow.com/a/10076097/151365 \*/ var hash = window.location.hash.substring(1); if (hash) { /\* \* Best practice for javascript redirects: \* https://stackoverflow.com/a/506004/151365 \*/ window.location.replace(anchorMap[hash]); } })(); ++++ A 'link:https://en.wikipedia.org/wiki/Reverse\_proxy[reverse proxy]' allows an alternate HTTP or HTTPS provider to communicate with web browsers on behalf of Jenkins. The alternate provider may offer additional capabilities, like SSL encryption. The alternate provider may offload some work from Jenkins, like delivering static images. == General Guidelines Jenkins actively monitors reverse proxy configuration. Jenkins reports xref:user-docs:system-administration:reverse-proxy-configuration-troubleshooting.adoc["`+Your reverse proxy setup is broken+`"] when it detects a reverse proxy configuration problem. Refer to the xref:user-docs:system-administration:reverse-proxy-configuration-troubleshooting.adoc[troubleshooting] section if Jenkins is reporting that your reverse proxy setup is broken. === Background Reverse proxies receive inbound HTTP requests and forward those requests to Jenkins. It receives the outbound HTTP response from Jenkins and forwards those requests to the original requester. A correctly configured reverse proxy rewrites \*both\* the HTTP request and the HTTP response. When HTTP request rewriting is misconfigured, pages won't be displayed at all. Refer to \*link:#configuration-examples[Configuration Examples by Server Type]\* if your reverse proxy is not displaying any Jenkins pages. A reverse proxy must handle the HTTP response by either rewriting the response or setting HTTP headers on the forwarded request. When HTTP response handling is misconfigured, Jenkins may fail to show updated information on a page or it may ignore changes submitted through web pages. Refer to the xref:user-docs:system-administration:reverse-proxy-configuration-troubleshooting.adoc[troubleshooting] section if Jenkins is reporting that your reverse proxy setup is broken or pages are not behaving as expected. [#configuration-examples] == Configuration Examples by Server Type Jenkins works with many different reverse proxies. This section provides examples for specific reverse proxies, though much of the information also applies to other reverse proxies. \* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-apache.adoc[Running Jenkins with Apache] \* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-nginx.adoc[Running Jenkins with Nginx] \* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-lighttpd.adoc[Running Jenkins with Lighttpd] \* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-haproxy.adoc[Running Jenkins with HAProxy] \* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-pomerium.adoc[Running Jenkins with Pomerium] \* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-squid.adoc[Running Jenkins with Squid] \* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iis.adoc[Running Jenkins with IIS] \* xref:reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-iptables.adoc[Running Jenkins with iptables] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/system-administration/pages/reverse-proxy-configuration-with-jenkins/index.adoc | main | jenkins | [
-0.03767923638224602,
0.05256505683064461,
-0.015871582552790642,
0.037282440811395645,
-0.039667773991823196,
-0.06828249245882034,
-0.031507790088653564,
-0.03969026729464531,
-0.0309393722563982,
0.0027743421960622072,
-0.03287654370069504,
0.008414491079747677,
0.00990153569728136,
-0.... | 0.033847 |
image::https://raw.githubusercontent.com/jenkins-infra/jenkins.io/d64ddebd0a7d02772c10a77f1f4890b93b6961e7/content/images/logos/jenkins/Jenkins-stop-the-war.svg["Stop the war",200px,float=left] == This is tutorial Build great things at any scale The leading open source automation server, Jenkins provides hundreds of plugins to support building, deploying and automating any project. Ukraine We stand with the people of Ukraine. Please assist humanitarian efforts for the Ukrainian people and those affected by the military invasion of Ukraine by supporting international aid organizations, including the link:https://www.icrc.org/[International Committee of the Red Cross] +++ Documentation Download +++ | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/template/pages/index.adoc | main | jenkins | [
-0.09579741209745407,
0.05008312687277794,
0.022921528667211533,
0.011243855580687523,
0.048244550824165344,
-0.06099030375480652,
-0.0457475520670414,
-0.0447162427008152,
-0.026281535625457764,
0.012823531404137611,
-0.12269128859043121,
0.01815953105688095,
0.025208022445440292,
0.04015... | 0.214271 |
= Diagnosing Errors This page provides guidelines about diagnosing the most common types of errors you may see when using Jenkins. [#out-of-memory-error] == Out Of Memory Errors `OutOfMemoryError` errors may happen for many different reasons: - Your Jenkins is growing in data size, requiring a bigger heap space. In this case you just want to give it a bigger heap. - Your Jenkins is temporarily processing a large amount of data (like test reports), requiring a bigger head room in memory. In this case you just want to give it a bigger heap. - Your Jenkins is leaking memory, in which case we need to fix that. - The Operating System kernel is running out of virtual memory. Which category your `OutOfMemoryError` falls into is not always obvious, but here are a few useful techniques to diagnose the problem. - Use https://visualvm.github.io/[VisualVM], attach to the running instance, and observe the memory usage. Does the memory max out while loading Jenkins? If so, it probably just needs a bigger memory space. Or is it slowing creeping up? If so, maybe it is a memory leak. - Do you consistently see `OutOfMemoryError` around the same phase in a build? If so, maybe it just needs a bigger memory. - In cases where virtual memory is running short the kernel `OutOfMemoryError` killer may forcibly kill Jenkins or individual builds. If this occurs on Linux you may see builds terminate with exit code `137` (`128` + signal number for `SIGKILL`). The `dmesg` command output will show log messages that will confirm the action that the kernel took. If you think it's a memory leak, the Jenkins team needs to get the heap dump to be able to fix the problem. There are several ways to go about this. - Run JVM with `-XX:+HeapDumpOnOutOfMemoryError` so that JVM will automatically produce a heap dump when it hits `OutOfMemoryError`. - You can run `jmap -dump:live,file=/tmp/jenkins.hprof pid` where pid is the process ID of the target Java process. - Use https://visualvm.github.io/[VisualVM], attach to the running instance, and obtain a heap dump - If your Jenkins runs at `http://server/jenkins/`, request `http://server/jenkins/heapDump` with your browser and you'll get the heap dump downloaded. - If you are familiar with one of many Java profilers, they normally offer this capability, too. Once you obtain the heap dump, please post it somewhere, then open an issue (or look for a duplicate issue), and attach a pointer to it. Please be aware that heap dumps may contain confidential information of various sorts. If the full heap dump is too big, please try to get us the heap histogram (`jmap -histo:live pid`). In the past, the distributed build support has often been a source of leakage (as this involves in a distributed garbage collection.) To check for this possibility, visit links like `http://yourserver/jenkins/computer/YOURAGENTNAME/dumpExportTable`. If this show too many objects, they may be leaks. === Analyzing the heap dump yourself If you cannot let us inspect your heap dump, we need to ask you to diagnose the leak. - First, find the objects with biggest retention size. Often they are various Maps, arrays, or buffers. - Next, find the path from that object to GC root, so that you can see which Jenkins object owns those big objects. Report the summary of those findings to the list and we'll take it from there. === Using VisualVM Unless you already have a preferred memory profiling tool, VisualVM is recommended for analyzing heap dumps. It is a standalone version of the NetBeans profiler, distributed with the Oracle JDK. Run `jvisualvm` and use \*File » Load\* and select the | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/troubleshooting/pages/diagnosing-errors.adoc | main | jenkins | [
0.026630476117134094,
0.010801841504871845,
-0.004070905968546867,
0.06477765738964081,
0.050415292382240295,
-0.08950990438461304,
-0.05710609257221222,
0.06715228408575058,
0.031841639429330826,
0.028292067348957062,
-0.0664936825633049,
-0.038676775991916656,
-0.007852907292544842,
-0.0... | 0.047175 |
list and we'll take it from there. === Using VisualVM Unless you already have a preferred memory profiling tool, VisualVM is recommended for analyzing heap dumps. It is a standalone version of the NetBeans profiler, distributed with the Oracle JDK. Run `jvisualvm` and use \*File » Load\* and select the heap dump. In the \*Classes\* tab, look for a class with a suspiciously large number of instances, if not already identified by `jmap -histo`. For example, to debug a Groovy script leak, type `GroovyClassLoader` in the filter field and double-click the line with no `$` in it (just `groovy.lang.GroovyClassLoader`). In the \*Instances\* tab you should now see all instances. Click on some at random. (If there are more than 500, they will be broken into groups of 500, with the first expanded; so to get a representative instance "from the middle", collapse the first group, expand a group in the middle, and select some instance from that group.) Under \*References\*, right-click `this` and select \*Show Nearest GC Root\*. Right-click the selected item in the tree and select \*Copy Path From Root\*. Paste this text, for several examples, into a text file and attach it to a bug report—or continue your investigation into plugin source code. == How to Report a Bug For easier bug reporting, you can get the full list of plugins with this Groovy script that you can run in \*\*Jenkins > Manage Jenkins > Script Console\*\*: [source,java] ---- println("Jenkins: ${Jenkins.instance.getVersion()}") println("OS: ${System.getProperty('os.name')} - ${System.getProperty('os.version')}") println("Java: ${System.getProperty('java.version')} - ${System.getProperty('java.vm.vendor')} (${System.getProperty('java.vm.name')})") println "---" Jenkins.instance.pluginManager.plugins .collect() .sort { it.getShortName() } .each { plugin -> println("${plugin.getShortName()}:${plugin.getVersion()}") } return ---- xref:community:ROOT:report-issue.adoc[Report an issue] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/troubleshooting/pages/diagnosing-errors.adoc | main | jenkins | [
-0.027542077004909515,
0.023073872551321983,
-0.050302132964134216,
-0.042747147381305695,
0.05335202440619469,
-0.08296402543783188,
0.026326142251491547,
0.04664969444274902,
-0.06501714885234833,
0.004660484381020069,
-0.06474380940198898,
-0.08520478010177612,
0.006451268680393696,
-0.... | -0.00102 |
:page-aliases: user-docs:system-administration:obtaining-a-thread-dump.adoc = Obtaining a thread dump During the troubleshooting of Jenkins, others may request that you obtain thread dumps of relevant Java VMs. Thread dumps concisely capture what every thread in a VM is doing at a given point in time. They are useful to diagnose hang problems, deadlocks, and performance issues. This page explains how you can obtain a thread dump. [#Obtainingathreaddump-FromJenkinsWebUI] == From Jenkins Web UI This is the simplest way of obtaining thread dumps. If Jenkins or its build agents are operating normally, you can obtain a thread dump remotely by going to `+http://your.jenkins.server/threadDump+`. For an agent named 'xyz', go to `+http://your.jenkins.server/computer/xyz/systemInfo+`. You need to have the administrator permission on the system. [#Obtainingathreaddump-Byusingjstack] == By using `+jstack+` If Jenkins is not responding to web UI, try https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr016.html[jstack] to obtain the thread dump. You might have to add -F to get the dump. If that was the case, please mention that in the report as well. Make sure to run jstack as the same user that's running Jenkins itself instead of using the root user. [#Obtainingathreaddump-Bysendingsignal] == By sending signal If the above two approaches do not work, you can still have the JVM print the thread dump to its stdout by sending it a signal. If you have a terminal or command prompt that's running the JVM, you can hit Ctrl+ + (Unix) or Ctrl+Break (Windows) to do this. If the JVM is running in background, you do this by `+kill -3 PID+` (Unix) or use https://docs.oracle.com/javacomponents/jmc-5-5/jmc-user-guide/toc.htm/[a tool like this] to send a signal (Windows). You need to be on the same machine as the Jenkins controller when you run this command. In a situation like this, the standard output of JVM is normally redirected to a log file, so you need to hunt down where it is written to and pick up the dump from there. On Unix, you can look at `+/proc/PID/fd/1+` to figure out which file the stdout is being written to. If you are running as a Windows service, see the xref:installing-jenkins:windows.adoc[Windows installation instructions] for the log file location. This approach is platform specific, but it tends to be more reliable even when JVM is in a dire state. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/troubleshooting/pages/obtaining-a-thread-dump.adoc | main | jenkins | [
-0.05093139037489891,
0.009309894405305386,
0.02058175951242447,
-0.03331327810883522,
0.0421316958963871,
-0.04692956060171127,
-0.05453332141041756,
-0.0824684202671051,
0.0242402795702219,
0.023883378133177757,
-0.06454697996377945,
-0.0520731657743454,
-0.04662087559700012,
-0.09770542... | 0.049519 |
= Pipeline Editor The Blue Ocean Pipeline Editor is an easy way for anyone to get started with creating Pipelines in Jenkins. It's also great for existing Jenkins users to start adopting Pipeline. include::partial$blue-ocean-status.adoc[] The editor allows users to create and edit Declarative Pipelines and perform actions such as adding stages or configuring parallel tasks, depending on their needs. When the user completes their configuration, the editor saves the Pipeline to a source code repository as a `Jenkinsfile`. If the Pipeline requires further modification, Blue Ocean makes it easy to jump back into the visual editor to modify the Pipeline at any time. video::FhDomw6BaHU[youtube, width=640, height=360, align="center"] [NOTE] .Blue Ocean Pipeline Editor limitations ==== The Blue Ocean Pipeline Editor is a great alternative for Jenkins users, but there are some limitations to its functionality: \* The editor utilizes SCM-based Declarative Pipelines only. \* User credentials must have write permission. \* The editor does not have full parity with Declarative Pipeline. \* The Pipeline is re-ordered and comments are removed. ==== == Starting the editor To use the editor, a user must first xref:./creating-pipelines.adoc[create a Pipeline in Blue Ocean] or have at least one existing Pipeline in Jenkins. If editing an existing Pipeline, the credentials for that Pipeline must allow pushing changes to the target repository. The editor can be launched through the: \* \*New Pipeline\* option from the xref:blueocean:dashboard.adoc[Blue Ocean dashboard]. \* \*Branches\* tab within the xref:blueocean:activity.adoc#branches[Activity view]. \* \*Edit\* (icon:pencil[]) in the Pipeline run details view. == Navigation bar The Pipeline editor includes the xref:./getting-started.adoc#navigation-bar[standard navigation bar] at the top, with a local navigation bar below it. The local navigation bar includes: \* \*Pipeline Name\* - This also includes the branch name. \* \*Cancel\* - Discards changes made to the pipeline. \* \*Save\* - Opens the xref:#save-pipeline-dialog[ save Pipeline dialog]. == Pipeline Settings By default, the pane on the right side of the editor displays the \*Pipeline Settings\*. Selecting an existing stage or adding a stage displays the xref:blueocean:pipeline-editor.adoc#stage-configuration[stage configuration] pane instead. To navigate back to the \*Pipeline Settings\* pane, select any empty space in the background of the editor. Within the Pipeline Settings pane, there are two sections that are configurable. === Agent The \*Agent\* section controls which agent the Pipeline uses. This performs the same process as the xref:pipeline:syntax.adoc#agent[agent directive]. The \*Image\* field allows users to configure which container image runs when the Pipeline is active. === Environment The \*Environment\* section allows users to configure environment variables for the Pipeline. This is the same process as the xref:pipeline:syntax.adoc#environment[environment directive]. == Stage editor The left pane displays the stage editor UI, which allows users to create or add stages of a Pipeline. image::editor/stage-editor-basic.png[Stage editor view of new pipeline., role=center] \* To add a stage to the Pipeline, select the icon:plus[] icon to the right of an existing stage. Selecting the icon:plus[] icon below an existing stage adds a parallel stage. \* To delete unwanted stages, use the xref:#stage-configuration[ more menu in the stage configuration pane]. After setting the stage name and saving, the name displays above the stage. Stages that contain incomplete or invalid information display a icon:warning[]. Pipelines can have validation errors during editing, but saving is blocked until the errors are fixed. image::editor/stage-editor-error.png[Stage editor with error displayed., role=center] [#stage-configuration] == Stage configuration Selecting a stage in the editor displays the \*Stage Configuration\* pane on the right side of the screen. Here, you can modify the name of the stage, delete the stage, and add steps to a stage. image::editor/stage-configuration.png[Stage configuration pane, role=center] The name of the stage can be set at the top of the stage | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/pipeline-editor.adoc | main | jenkins | [
-0.022156372666358948,
-0.04656793177127838,
-0.024996081367135048,
-0.005174072925001383,
-0.026381801813840866,
0.0133336391299963,
-0.12221658229827881,
-0.0037519631441682577,
-0.019737744703888893,
-0.024269836023449898,
-0.0834319218993187,
-0.07264476269483566,
-0.01310787070542574,
... | 0.082885 |
the editor displays the \*Stage Configuration\* pane on the right side of the screen. Here, you can modify the name of the stage, delete the stage, and add steps to a stage. image::editor/stage-configuration.png[Stage configuration pane, role=center] The name of the stage can be set at the top of the stage configuration pane. The more menu, represented by three dots to the right of the stage name, allows users to delete the currently selected stage. Selecting \*Add step\* displays the list of available step types. After selecting a step type, the page displays the step configuration pane. image::editor/step-list.png[Step list filtered by 'file', role=center] == Step configuration This pane display is based on the step type selected, and contains the necessary fields or controls. image::editor/step-configuration.png[Step configuration for JUnit step, role=center] Be sure to provide a strong name for the step, as the name retains its original configuration. Deleting the step and recreating it is the only way to provide a different name. The more menu, represented by three dots to the right of the step name, allows users to delete the current step. Fields that contain incomplete or invalid information display a icon:exclamation[]. Any validation errors must be addressed before saving. image::editor/step-error.png[Step configuration with error, role=center] [#save-pipeline-dialog] == Save Pipeline dialog Changes to a Pipeline must be saved in source control before running. The \*Save Pipeline\* dialog controls the saving of changes to source control. image::editor/save-pipeline.png[Save Pipeline dialog, role=center] You can optionally enter a description of the changes before saving. The dialog also provides options for saving changes to the same branch or creating a new branch to save to. Selecting \*Save & run\* saves any changes to the Pipeline as a new commit, starts a new Pipeline run based on those changes, and navigates to the Activity view for this pipeline. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/pipeline-editor.adoc | main | jenkins | [
-0.04519861936569214,
0.07775143533945084,
-0.02017075940966606,
0.018173404037952423,
0.002939876401796937,
0.05354762822389603,
-0.02076113224029541,
-0.0019825410563498735,
0.046239230781793594,
-0.012862580828368664,
-0.0494672991335392,
-0.010078225284814835,
0.07110333442687988,
-0.0... | 0.032987 |
= Creating a Pipeline Blue Ocean makes it easy to create a Pipeline project in Jenkins. You can generate a Pipeline from an existing `Jenkinsfile` in source control, or you can use the xref:blueocean:pipeline-editor.adoc[Blue Ocean Pipeline editor] to create a Pipeline as a `Jenkinsfile` that is committed to source control. include::partial$blue-ocean-status.adoc[] == Setting up your Pipeline project To start setting up your Pipeline project in Blue Ocean, select the \*New Pipeline\* button at the top-right of the xref:blueocean:dashboard.adoc[Blue Ocean Dashboard]. [.boxshadow] image::creating-pipelines/new-pipeline-button.png['New Pipeline Button',width=50%] If your Jenkins instance is new or has no Pipeline projects or other items configured, Blue Ocean displays a \*Welcome to Jenkins\* message that allows you to select the \*Create a new Pipeline\* option to start setting up your Pipeline project. [.boxshadow] image::creating-pipelines/create-a-new-pipeline-box.png['Welcome to Jenkins - Create a New Pipeline message box',width=50%] You now have a choice of creating your new Pipeline project from a: \* link:#for-a-git-repository[Standard Git repository] \* link:#for-a-repository-on-github[Repository on GitHub] or GitHub Enterprise \* link:#for-a-repository-on-bitbucket-cloud[Repository on Bitbucket Cloud] or Bitbucket Server [#for-a-git-repository] === For a Git repository To create your Pipeline project for a Git repository, click the \*Git\* button under \*Where do you store your code?\* [.boxshadow] image::creating-pipelines/where-do-you-store-your-code.png['Where do you store your code',width=70%] In the \*Connect to a Git repository\* section, enter the URL for your Git repository in the \*Repository URL\* field. [.boxshadow] image::creating-pipelines/connect-to-a-git-repository.png['Connect to a Git repository',width=70%] You now must specify a link:#local-repository[local] or link:#remote-repository[remote] repository from which to build your Pipeline project. [#local-repository] ==== Local repository If your URL is a local directory path beginning with a forward slash `/`, such as `/home/cloned-git-repos/my-git-repo.git`, you can proceed to select the \*Create Pipeline\* option. Blue Ocean then scans your local repository's branches for a `Jenkinsfile`, and starts a Pipeline run for each branch containing a `Jenkinsfile`. If Blue Ocean cannot find a `Jenkinsfile`, you are prompted to create one through the xref:blueocean:pipeline-editor.adoc[Blue Ocean Pipeline editor]. Local repositories are typically limited to file system access and are normally only available from the controller node. Local repositories are also known to require more complicated path names on Windows than most users want to manage. Users are advised to run jobs on agents, rather than running them directly on the controller. Therefore, you should use a remote repository rather than a local repository for the best Blue Ocean experience. [#remote-repository] ==== Remote repository Since the Pipeline editor saves edited Pipelines to Git repositories as `Jenkinsfile`s, Blue Ocean only supports connections to remote Git repositories over the SSH protocol. If your URL is for a remote Git repository, be sure your URL starts with either: \* `ssh://` - which displays as `ssh://gituser@git-server-url/git-server-repos-group/my-git-repo.git` + or \* `user@host:path/to/git/repo.git` - which displays as `gituser@git-server-url:git-server-repos-group/my-git-repo.git` Blue Ocean automatically generates an SSH public/private key pair or provides you with an existing pair for the current Jenkins user. This credential is automatically registered in Jenkins with the following details for this Jenkins user: \* \*Domain\*: `blueocean-private-key-domain` \* \*ID\*: `jenkins-generated-ssh-key` \* \*Name\*: ` (jenkins-generated-ssh-key)` You must ensure that this SSH public/private key pair is registered with your Git server before continuing. If you have not already done this, follow these two steps. . Configure the SSH public key component of this key pair (which you can copy and paste from the Blue Ocean interface) for the remote Git server's user account (e.g., within the `authorized\_keys` file of the machine's `gituser/.ssh` directory). + NOTE: This process allows your Jenkins user to access the repositories that your Git server's user account has access to. Refer to the link:https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server["Setting Up the Server"] of the link:https://git-scm.com/book/en/v2/[Pro Git documentation]. . Return to the Blue Ocean interface. Select | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/creating-pipelines.adoc | main | jenkins | [
-0.02577197179198265,
-0.08544056862592697,
-0.05045171082019806,
0.013553903438150883,
0.02008907124400139,
-0.0397673174738884,
-0.03680359572172165,
-0.00889680441468954,
-0.005887087434530258,
0.015861833468079567,
-0.04116881638765335,
-0.1024819016456604,
0.02050246112048626,
-0.0074... | 0.032263 |
within the `authorized\_keys` file of the machine's `gituser/.ssh` directory). + NOTE: This process allows your Jenkins user to access the repositories that your Git server's user account has access to. Refer to the link:https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server["Setting Up the Server"] of the link:https://git-scm.com/book/en/v2/[Pro Git documentation]. . Return to the Blue Ocean interface. Select the \*Create Pipeline\* option. Blue Ocean scans your local repository's branches for a `Jenkinsfile` and starts a Pipeline run for each branch containing a `Jenkinsfile`. If Blue Ocean does not find a `Jenkinsfile` you are prompted to create one through the xref:blueocean:pipeline-editor.adoc[Pipeline editor]. [#for-a-repository-on-github] === For a repository on GitHub To create your Pipeline project directly for a repository on GitHub, select the \*GitHub\* option under \*Where do you store your code?\*. [.boxshadow] image::creating-pipelines/where-do-you-store-your-code.png['Where do you store your code',width=70%] In the \*Connect to GitHub\* section, enter your GitHub access token into the \*Your GitHub access token\* field. + If you previously configured Blue Ocean to connect to GitHub using a personal access token, Blue Ocean takes you directly to the xref:#choose-your-github-account[GitHub account/organization and repository choice] steps below: [.boxshadow] image::creating-pipelines/connect-to-github.png['Connect to GitHub',width=70%] If you do not have a GitHub access token, select the \*Create an access key here\* option to open GitHub to the link:#create-your-access-token[New personal access token] page. [#create-your-access-token] ==== Create your access token . In the new tab, sign in to your GitHub account. On the \*New Personal Access Token\* page, specify a brief \*Token description\* for your GitHub access token, such as `Blue Ocean`. + NOTE: An access token is usually an alphanumeric string that represents your GitHub account, along with permissions to access various GitHub features and areas through your GitHub account. The new access token process, initiated by selecting \*Create an access key here\*, has the appropriate permissions pre-selected that Blue Ocean requires to access and interact with your GitHub account. . Scroll down to the end of the page, and select \*Generate token\*. . On the resulting \*Personal access tokens\* page, copy your newly generated access token. . Back in Blue Ocean, paste the access token into the \*Your GitHub access token\* field, and then select \*Connect\*. Your current Jenkins user now has access to your GitHub account and you can now xref:#choose-your-github-account[choose your GitHub account/organization and repository]. Jenkins registers this credential with the following details for this Jenkins user: \* \*Domain\*: `blueocean-github-domain` \* \*ID\*: `github` \* \*Name\*: `+/\*\*\*\*\*\* (GitHub Access Token)+` [#choose-your-github-account] ==== Choose your GitHub account/organization and repository Blue Ocean prompts you to choose your GitHub account or an organization you are a member of. You are also asked for the repository containing your Pipeline project. . In the \*Which organization does the repository belong to?\* section, select either: + \* Your GitHub account, to create a Pipeline project for one of your own GitHub repositories or one which you have forked from elsewhere on GitHub. + or \* The organization of which you are a member, to create a Pipeline project for a GitHub repository located within this organization. . In the \*Choose a repository\* section, select the repository within your GitHub account or organization from which to build your Pipeline project. + TIP: If your list of repositories is long, you can use the \*Search\* option to filter your results. [.boxshadow] image::creating-pipelines/choose-a-repository.png['Choose a repository',width=70%] . Click \*Create Pipeline\*. Blue Ocean scans your local repository's branches for a `Jenkinsfile` and starts a Pipeline run for each branch containing a `Jenkinsfile`. If Blue Ocean does not find a `Jenkinsfile`, you are prompted to create one through the xref:blueocean:pipeline-editor.adoc[Pipeline editor]. NOTE: Under the hood, a Pipeline project created through Blue Ocean is actually a | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/creating-pipelines.adoc | main | jenkins | [
0.021369842812418938,
-0.09666091203689575,
-0.0677226185798645,
0.009865064173936844,
0.01845700852572918,
-0.010930318385362625,
-0.021342875435948372,
0.025559576228260994,
0.011548834852874279,
0.026723656803369522,
0.005669028032571077,
-0.03501104563474655,
0.04855324700474739,
-0.02... | -0.000026 |
your local repository's branches for a `Jenkinsfile` and starts a Pipeline run for each branch containing a `Jenkinsfile`. If Blue Ocean does not find a `Jenkinsfile`, you are prompted to create one through the xref:blueocean:pipeline-editor.adoc[Pipeline editor]. NOTE: Under the hood, a Pipeline project created through Blue Ocean is actually a "multibranch Pipeline." Therefore, Jenkins looks for the presence of at least one Jenkinsfile in any branch of your repository. [#for-a-repository-on-bitbucket-cloud] === For a repository on Bitbucket Cloud To create your Pipeline project directly for a Git or Mercurial repository on Bitbucket Cloud, select the \*Bitbucket Cloud\* button under \*Where do you store your code?\* [.boxshadow] image::creating-pipelines/where-do-you-store-your-code.png['Where do you store your code',width=70%] In the \*Connect to Bitbucket\* section, enter your Bitbucket email address and password into the \*Username\* and \*Password\* fields. \* If you previously configured Blue Ocean to connect to Bitbucket with your email address and password, Blue Ocean takes you directly to the link:#choose-your-bitbucket-account[Bitbucket account/team and repository selection] steps below. \* If you entered these credentials, Jenkins registers them with the following details for this Jenkins user: \* \*Domain\*: `blueocean-bitbucket-cloud-domain` \* \*ID\*: `bitbucket-cloud` \* \*Name\*: `+/\*\*\*\*\*\* (Bitbucket server credentials)` [.boxshadow] image::creating-pipelines/connect-to-bitbucket.png['Connect to Bitbucket',width=70%] Select \*Connect\* and your current/logged in Jenkins user will now have access to your Bitbucket account. You can now xref:#choose-your-bitbucket-account[choose your Bitbucket account/team and repository]. [#choose-your-bitbucket-account] ==== Choose your Bitbucket account/team and repository Blue Ocean prompts you to choose your Bitbucket account or a team you are a member of, as well as the repository containing your project to be built. . In the \*Which team does the repository belong to?\* section, select either: \* Your Bitbucket account to create a Pipeline project for one of your own Bitbucket repositories, or one which you have forked from elsewhere on Bitbucket. \* A team of which you are a member to create a Pipeline project for a Bitbucket repository located within this team. . In the \*Choose a repository\* section, select the repository in your Bitbucket account or team from which to build your Pipeline project. + TIP: If your list of repositories is long, you can filter this list using the \*Search\* option. + [.boxshadow] image::creating-pipelines/choose-a-repository.png['Choose a repository',width=70%] . Click \*Create Pipeline\*. + Blue Ocean scans your local repository's branches for a `Jenkinsfile` and starts a Pipeline run for each branch containing a `Jenkinsfile`. If Blue Ocean does not find a `Jenkinsfile`, you are prompted to create one through the xref:blueocean:pipeline-editor.adoc[Pipeline editor]. NOTE: Under the hood, a Pipeline project created through Blue Ocean is actually a "multibranch Pipeline." Therefore, Jenkins looks for the presence of at least one Jenkinsfile in any branch of your repository. //// === For a repository on Bitbucket Server //// | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/creating-pipelines.adoc | main | jenkins | [
0.0009470892255194485,
-0.08250049501657486,
-0.023072602227330208,
0.020209887996315956,
0.03604792058467865,
-0.056069083511829376,
-0.07408362627029419,
-0.010194124653935432,
0.05832821503281593,
0.0292916689068079,
-0.014816764742136002,
-0.056999288499355316,
0.03725842386484146,
-0.... | -0.032149 |
= Getting started with Blue Ocean This section describes how to get started with Blue Ocean in Jenkins. It includes instructions for link:#installing-blue-ocean[setting up Blue Ocean] on your Jenkins controller, how to link:#accessing-blue-ocean[access the Blue Ocean UI], and link:#switching-to-the-classic-ui[returning to the Jenkins classic UI]. include::partial$blue-ocean-status.adoc[] [#installing-blue-ocean] == Installing Blue Ocean You can install Blue Ocean using the following methods: \* As a suite of plugins on an xref:#on-an-existing-jenkins-instance[existing Jenkins controller]. \* As a part of xref:#as-part-of-jenkins-in-docker[Jenkins in Docker]. [#on-an-existing-jenkins-instance] === On an existing Jenkins controller When Jenkins is installed on most platforms, the {plugin}blueocean[Blue Ocean] plugin and all necessary dependent plugins, which compile the Blue Ocean suite of plugins, are not installed by default. Plugins can be installed on a Jenkins controller by any Jenkins user who has the \*Administer\* permission. This is set through \*Matrix-based security\*. Jenkins users with this permission can also configure the permissions of other users on their system. Refer to the xref:user-docs:security:managing-security.adoc#authorization[Authorization] section of xref:user-docs:security:managing-security.adoc[Managing Security] for more information. To install the Blue Ocean suite of plugins to your Jenkins controller: . Ensure you are logged in to Jenkins as a user with the \*Administer\* permission. . From the Jenkins home page, select \*Manage Jenkins\* on the left and then \*Plugins\*. . Select the \*Available\* tab and enter `blue ocean` in the \*Filter\* text box. This filters the list of plugins based on the name and description. + [.boxshadow] image::user-docs:blueocean:blueocean-plugins-filtered.png[alt="Available Blue Ocean plugins after being filtered list.",width=100%] . Select the box to the left of \*Blue Ocean\*, and then select either the \*Download now and install after restart\* option (recommended) or the \*Install without restart\* option at the bottom of the page. + [NOTE] ==== \* It is not necessary to select other plugins in this list. The main \*Blue Ocean\* plugin automatically selects and installs all dependent plugins, composing the Blue Ocean suite of plugins. \* If you select the \*Install without restart\* option, you must restart Jenkins to gain full Blue Ocean functionality. ==== Refer to the the xref:user-docs:managing:plugins.adoc[Managing Plugins] page for more information. Blue Ocean does not require additional configuration after installation. Existing Pipelines and projects will continue to work as usual. NOTE: The first time you xref:creating-pipelines.adoc[create a Pipeline in Blue Ocean] for a specific Git server, Blue Ocean prompts you for your Git credentials to allow you to create Pipelines in the repositories. This is required since Blue Ocean can add a `Jenkinsfile` to your repositories. [#as-part-of-jenkins-in-docker] === As part of Jenkins in Docker The Blue Ocean suite of plugins is not bundled with the official Jenkins Docker image, link:https://hub.docker.com/r/jenkins/jenkins/[`jenkins/jenkins`], which is available from the link:https://hub.docker.com/[Docker Hub repository]. Read more about running Jenkins and Blue Ocean inside Docker in the xref:user-docs:installing-jenkins:docker.adoc[Docker] section of the installing Jenkins page. [#accessing-blue-ocean] == Accessing Blue Ocean Once a Jenkins environment has Blue Ocean installed and you log in to the Jenkins classic UI, you can access the Blue Ocean UI by selecting \*Open Blue Ocean\* on the left side of the screen. [.boxshadow] image:user-docs:blueocean:intro/open-blue-ocean-link.png[alt="Open Blue Ocean link",width=20%] Alternatively, you can access Blue Ocean directly by appending `/blue` to the end of your Jenkins server's URL. For example `\https://jenkins-server-url/blue`. If your Jenkins controller: \* Already has existing Pipeline projects or other items present, the xref:dashboard.adoc[Blue Ocean Dashboard] displays. \* Is new or does not have projects or other items configured, Blue Ocean displays a \*Welcome to Jenkins\* pane with a \*Create a new Pipeline\* button. You can select this to begin creating a new Pipeline project. For more information, refer to the xref:creating-pipelines.adoc[Creating a Pipeline] page for more information on creating a Pipeline project in | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/getting-started.adoc | main | jenkins | [
-0.023667285218834877,
-0.03505532070994377,
-0.006652914918959141,
-0.007104290649294853,
0.06054321303963661,
-0.02165849693119526,
0.004039343912154436,
-0.020337393507361412,
-0.03206241503357887,
-0.03354121372103691,
0.01846279762685299,
-0.07135482132434845,
0.03777001425623894,
0.0... | 0.03587 |
projects or other items configured, Blue Ocean displays a \*Welcome to Jenkins\* pane with a \*Create a new Pipeline\* button. You can select this to begin creating a new Pipeline project. For more information, refer to the xref:creating-pipelines.adoc[Creating a Pipeline] page for more information on creating a Pipeline project in Blue Ocean. + [.boxshadow] image:creating-pipelines/create-a-new-pipeline-box.png['Welcome to Jenkins - Create a New Pipeline message box',width=50%] [#navigation-bar] == Navigation bar The Blue Ocean UI has a navigation bar along the top of its interface, allowing you to access the different views and features. The navigation bar is divided into two sections: \* A common section along the top of most Blue Ocean views. \* A contextual section below. The contextual section is specific to the current Blue Ocean page you are viewing. The navigation bar's common section includes the following buttons: \* \*Jenkins\*: Selecting the Jenkins icon takes you to the xref:dashboard.adoc[Dashboard] or reloads this page if you are already viewing it. \* \*Pipelines\*: This also takes you to the Dashboard. If you are already on the Dashboard, this option reloads the page. This button serves a different purpose when you are viewing a xref:pipeline-run-details.adoc[Pipeline run details] page. \* \*Administration\*: This takes you to the \*xref:user-docs:managing:index.adoc[Manage Jenkins]\* page of the Jenkins classic UI. This button is not available if you do not have the \*Administer\* permission. Refer to the xref:user-docs:security:managing-security.adoc#authorization[Authorization] section of the Managing Security page for more information. \* \*Go to classic\* icon: This takes you back to the Jenkins classic UI. Read more about this in xref:#switching-to-the-classic-ui[Switching to the classic UI]. \* \*Logout\*: This logs out your current Jenkins user and returns you to the Jenkins login page. Views that use the common navigation bar add another bar below it. This second bar includes options specific to that view. Some views replace the common navigation bar with one specifically suited to that view. [#switching-to-the-classic-ui] == Switching to the classic UI Blue Ocean does not support some legacy or administrative features of Jenkins that are necessary to some users. If you need to access these features, select the \*Go to classic\* icon at the top of a common section of Blue Ocean's xref:#navigation-bar[navigation bar]. [.boxshadow] image:user-docs:blueocean:intro/go-to-classic-icon.png[alt="Go to classic icon",width=5%] Selecting this button takes you to the equivalent page in the Jenkins classic UI or the most relevant classic UI page that parallels the current page in Blue Ocean. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/getting-started.adoc | main | jenkins | [
-0.022433610633015633,
-0.02710043452680111,
0.015064017847180367,
0.004164988175034523,
0.07586011290550232,
-0.04473070800304413,
-0.021915296092629433,
-0.021142132580280304,
0.034897640347480774,
-0.03752816841006279,
-0.06389495730400085,
-0.05279437080025673,
0.006620221305638552,
-0... | 0.078351 |
= Dashboard Blue Ocean's "Dashboard" is the default view when opening Blue Ocean. It displays an overview of all Pipeline projects configured on a Jenkins controller. include::blueocean:partial$blue-ocean-status.adoc[] The Dashboard consists of a blue link:#navigation-bar[navigation bar] at the top, the link:#pipelines-list[Pipelines list], and the link:#favorites-list[Favorites list]. [.boxshadow] image:user-docs:blueocean:dashboard/overview.png[Overview of the Blue Ocean Dashboard,role=center,width=100%] [#navigation-bar] == Navigation bar The Dashboard includes the blue xref:getting-started.adoc#navigation-bar[navigation bar] along the top of the interface. The bar is divided into two sections: \* A common section along the top. \* A contextual section below. \*\* The contextual section changes depending on the Blue Ocean page you are viewing. When viewing the Dashboard, the navigation bar's contextual section includes: \* \*Search pipelines\*: This field allows users to filter the link:#pipelines-list[Pipelines list] to match the text you enter into this field. \* \*New Pipeline\*: This option begins the process of xref:creating-pipelines.adoc[creating a Pipeline]. [#pipelines-list] == Pipelines list The \*Pipelines\* list is the Dashboard's default list. It is the only list displayed the first time Blue Ocean is accessed. The list shows the overall state of each Pipeline configured in the Jenkins controller. The list can include other items configured in the Jenkins controller. The following information is displayed for each Pipeline listed: \* The item's \*NAME\* \* The item's link:#pipeline-health[\*HEALTH\*] \* The number of \*BRANCHES\* and pull requests \*(PRs)\* that are passing or failing within the Pipeline's source control repository. \* A ☆, indicating whether or not the item has been manually added to your current Jenkins xref:#favorites-list[favorites-list]. Selecting an item's ☆ will toggle between: \* Adding the default branch of the item's repository to your Favorites list, which is indicated by a solid ★. \* Removing the item's default branch from this list, which is indicated by an outlined ☆. Selecting an item in the Pipelines list will display that item's xref:activity.adoc[Activity View]. [#favorites-list] == Favorites list The Favorites list appears above the Dashboard's default xref:#pipelines-list[Pipelines list] when at least one Pipeline/item is present in your Favorites list. This list provides key information and actions for a core subset of your accessible items in the xref:#pipelines-list[Pipelines list]. This key information includes the current link:#run-status[run status] for an item and its repository's branch, the name of the branch, the initial part of the commit hash, and the last run time. This list also includes options to run or re-run the item on the indicated branch. You should only add an item or branch to your Favorites list if it needs regular monitoring. Adding an item's specific branch to your Favorites list can be done through the item's xref:activity.adoc[Activity View]. Blue Ocean automatically adds branches and PRs to this list when they include a run that contains any modifications you have performed. You can also manually remove items from your Favorites list by deselecting the solid ★ in this list. When there are no longer items in this list, the list is removed from the Dashboard. Selecting the favorite ★ for any item will bring the list back to your Dashboard. Selecting an item in the Favorites list opens the xref:pipeline-run-details.adoc[Pipeline run details] for the latest run on the branch or PR indicated. [#pipeline-health] === Health icons Blue Ocean represents the overall health of a Pipeline/item or one of its branches using weather icons. These icons change depending on the number of recent builds that have passed. Health icons on the Dashboard represent overall Pipeline health, whereas the health icons in the xref:blueocean:activity.adoc#branches[Branches tab of the Activity View] represent the overall health for each branch. .Health icons (best to worst) |=== |Icon |Health |image:user-docs:blueocean:icons/weather/sunny.svg[Sunny,role=center] |\*Sunny\*, more than 80% of | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/dashboard.adoc | main | jenkins | [
-0.01905044913291931,
0.0008319037151522934,
0.0012679019710049033,
-0.009427904151380062,
0.10039549320936203,
-0.024006998166441917,
-0.00189744692761451,
0.0037765493616461754,
0.014753668569028378,
-0.02133292332291603,
-0.05029430612921715,
-0.04761691391468048,
0.0488598607480526,
-0... | 0.061846 |
the number of recent builds that have passed. Health icons on the Dashboard represent overall Pipeline health, whereas the health icons in the xref:blueocean:activity.adoc#branches[Branches tab of the Activity View] represent the overall health for each branch. .Health icons (best to worst) |=== |Icon |Health |image:user-docs:blueocean:icons/weather/sunny.svg[Sunny,role=center] |\*Sunny\*, more than 80% of Runs passing |image:user-docs:blueocean:icons/weather/partially-sunny.svg[Partially Sunny,role=center] |\*Partially Sunny\*, 61% to 80% of Runs passing |image:user-docs:blueocean:icons/weather/cloudy.svg[Cloudy,role=center,width=100] |\*Cloudy\*, 41% to 60% of Runs passing |image:user-docs:blueocean:icons/weather/raining.svg[Raining,role=center] |\*Raining\*, 21% to 40% of Runs passing |image:user-docs:blueocean:icons/weather/storm.svg[Storm,role=center] |\*Storm\*, less than 21% of Runs passing |=== [#run-status] === Run status Blue Ocean represents the run status of a Pipeline/item or one of its branches using a consistent set of icons throughout. .Run status icons |=== |Icon |Status |image:user-docs:blueocean:dashboard/status-in-progress.png["In Progress" Status Icon,role=center] |\*In Progress\* |image:user-docs:blueocean:dashboard/status-passed.png["Passed" Status Icon,role=center] |\*Passed\* |image:user-docs:blueocean:dashboard/status-unstable.png["Unstable" Status Icon,role=center] |\*Unstable\* |image:user-docs:blueocean:dashboard/status-failed.png["Failed" Status Icon,role=center] |\*Failed\* |image:user-docs:blueocean:dashboard/status-aborted.png["Aborted" Status Icon,role=center] |\*Aborted\* |=== | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/dashboard.adoc | main | jenkins | [
0.044199347496032715,
-0.011705348268151283,
0.02452431060373783,
0.028968166559934616,
0.11518730968236923,
-0.09989463537931442,
0.0485767126083374,
-0.0020887204445898533,
-0.05136936530470848,
0.002643534215167165,
-0.011290173046290874,
-0.03178851306438446,
0.024496225640177727,
-0.0... | 0.065581 |
= Pipeline Run Details View The Blue Ocean Pipeline Run Details view shows the information related to a single Pipeline Run, and allows users to edit or replay that run. Below is a detailed overview of the parts of the Run Details view. include::partial$blue-ocean-status.adoc[] image::pipeline-run-details/overview.png[Overview of the Pipeline Run Details, role=center] . \*Run Status\* - An icon indicating the status of this Pipeline run. The color of the navigation bar matches the status icon. . \*Pipeline Name\* - The name of this run's Pipeline. . \*Run Number\* - The id number for this Pipeline run. Id numbers are unique for each Branch and Pull Request of a Pipeline. . \*View Tabs\* - Access the \*Pipeline\*, \*Changes\*, \*Tests\*, and \*Artifacts\* views with one of the xref:#tabs[tabs] for this run. The default view is "xref:#pipeline[Pipeline]". . \*Re-run Pipeline\* - Execute this run's Pipeline again. . \*Edit Pipeline\* - Open this run's Pipeline in the xref:blueocean:pipeline-editor.adoc[Pipeline Editor]. . \*Configure\* - Open the Pipeline configuration page in Jenkins. . \*Go to Classic\* - Switch to the "Classic" UI view of the details for this run. . \*Close Details\* - Closes the Details view and returns the user to the Activity view for this Pipeline. . \*Branch\* or \*Pull Request\* - The branch or pull request for this run. . \*Commit Id\* - The commit id for this run. . \*Duration\* - The duration of this run. . \*Completed Time\* - When this run was completed. . \*Change Author\* - Names of the authors with changes in this run. . \*Tab View\* - Shows the information for the selected tab. == Pipeline Run Status Blue Ocean makes it easy to see the status of the current Pipeline Run, by changing the color of the top menu bar to match the status: \* Blue for "In progress" \* Green for "Passed" \* Yellow for "Unstable" \* Red for "Failed" \* Gray for "Aborted" == Special cases Blue Ocean is optimized for working with Pipelines in Source Control, but can display details for other kinds of projects. Blue Ocean offers the same xref:#tabs[ tabs] for all supported projects types, but those tabs display different information depending on the type. === Pipelines outside of Source Control For Pipelines that are not based in Source Control, Blue Ocean shows the "Commit Id", "Branch", and "Changes", but those fields are left blank. In this case, the top menu bar does not include the "Edit" option. === Freestyle Projects For Freestyle projects, Blue Ocean offers the same xref:#tabs[ tabs], but the Pipeline tab only displays the console log output. The "Rerun" or "Edit" options are not available in the top menu bar. === Matrix projects Matrix projects are not supported in Blue Ocean. Viewing a Matrix project will redirect to the "Classic UI" view for that project. [#tabs] == Tabs Each tab of the Run Detail view provides information on a specific aspect of a run. [#pipeline] === Pipeline \*Pipeline\* is the default tab and gives an overall view of the flow of this Pipeline Run. It shows each stage and parallel branch, the steps in those stages, and the console output from those steps. The overview image above shows a successful Pipeline run. If a particular step during the run fails, this tab automatically defaults to showing the console log from the failed step. The image below shows a failed Run. image::pipeline-run-details/pipeline-failed.png[Failed Run, role=center] === Changes The \*Changes\* tab displays the information of any changes made between the most recently completed and current runs. This includes the commit id for the change, change author, message, and date completed. image::pipeline-run-details/changes-one-change.png[List of | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/pipeline-run-details.adoc | main | jenkins | [
0.000849883712362498,
0.002467300510033965,
-0.03663145750761032,
0.01453543920069933,
0.028515812009572983,
-0.03889857605099678,
0.01359522808343172,
-0.034116603434085846,
-0.019302381202578545,
-0.03598698973655701,
-0.022656625136733055,
-0.0644502267241478,
-0.015098596923053265,
-0.... | 0.058692 |
from the failed step. The image below shows a failed Run. image::pipeline-run-details/pipeline-failed.png[Failed Run, role=center] === Changes The \*Changes\* tab displays the information of any changes made between the most recently completed and current runs. This includes the commit id for the change, change author, message, and date completed. image::pipeline-run-details/changes-one-change.png[List of Changes for a Run, role=center] === Tests The \*Tests\* tab shows information about test results for this run. This tab only contains information if a test result publishing step is present, such as the "Publish JUnit test results" (`junit`) step. If no results are recorded, this table displays a message. If all tests pass, this tab will report the total number of passing tests. If there are failures, the tab will display log details from the failures as shown below. image::pipeline-run-details/tests-unstable.png[Test Results for Unstable Run, role=center] When a previous run has failures, and the current run fixes those failures, this tab notes the fixes and displays their logs. image::pipeline-run-details/tests-fixed.png[Test Results for Fixed Run, role=center] === Artifacts The \*Artifacts\* tab shows a list of any artifacts saved using the "Archive Artifacts" (`archiveArtifacts`) step. Selecting an item in the list downloads it. The full output log from the Run can be downloaded from this list. image::pipeline-run-details/artifacts-list.png[List of Artifacts from a Run, role=center] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/pipeline-run-details.adoc | main | jenkins | [
0.03374848514795303,
0.025267653167247772,
0.0009349721949547529,
0.052989810705184937,
0.044100381433963776,
-0.02213224582374096,
-0.06455010920763016,
0.027486706152558327,
0.013110258616507053,
0.013023466803133488,
-0.018584178760647774,
-0.02810405194759369,
0.03023882582783699,
-0.0... | 0.021155 |
[#blue-ocean] = Blue Ocean This chapter covers all aspects of Blue Ocean's functionality, including how to: \* xref:getting-started.adoc[get started with Blue Ocean], which covers how to set up Blue Ocean in Jenkins and access the Blue Ocean interface. \* xref:creating-pipelines.adoc[create a new Pipeline] project in Blue Ocean. \* use Blue Ocean's xref:dashboard.adoc[dashboard]. \* use the xref:activity.adoc[Activity view], where you can access xref:activity.adoc#activity[your current and historic run data], your Pipeline's xref:activity.adoc#branches[branches], and any open xref:activity.adoc#pull-requests[pull requests]. \* use the xref:pipeline-run-details.adoc[Pipeline run details view] to access details such as console output, for a particular Pipeline or item run. \* use the xref:pipeline-editor.adoc[Pipeline editor] to modify Pipelines as code, which you can then commit to source control. This chapter is intended for Jenkins users of all skill levels, but beginners may need to refer to the xref:user-docs:pipeline:getting-started.adoc[Pipeline] chapter to understand some topics covered here. For an overview of content in the Jenkins User Handbook, refer to xref:user-docs:getting-started:index.adoc[user handbook overview]. include::partial$blue-ocean-status.adoc[] [#blue-ocean-overview] == What is Blue Ocean? Blue Ocean as it stands provides easy-to-use Pipeline visualization. It was intended to be a rethink of the Jenkins user experience, designed from the ground up for xref:pipeline:index.adoc[Jenkins Pipeline]. Blue Ocean was intended to reduce clutter and increases clarity for all users. However, Blue Ocean will not receive further functionality or enhancement updates. It will only receive selective updates for significant security issues or functional defects. If you are just starting out, you can still use Blue Ocean, or you may want to consider alternative options such as the link:https://plugins.jenkins.io/pipeline-stage-view/[Pipeline: Stage View] and link:https://plugins.jenkins.io/pipeline-graph-view/[Pipeline Graph View] plugins. These offer some of the same functionality. To sum up, Blue Ocean's main features include: \* \*Sophisticated visualization\* of continuous delivery (CD) Pipelines, allowing for fast and intuitive comprehension of your Pipeline's status. \* \*Pipeline editor\* makes the creation of Pipelines more approachable, by guiding the user through a visual process to create a Pipeline. \* \*Personalization\* to suit the role-based needs of each member of the team. \* \*Pinpoint precision\* when intervention is needed or issues arise. Blue Ocean shows where attention is needed, facilitating exception handling and increasing productivity. \* \*Native integration for branches and pull requests\*, which enables maximum developer productivity when collaborating on code in GitHub and Bitbucket. If you would like to start using Blue Ocean, please refer to xref:getting-started.adoc[getting started with Blue Ocean]. video::k\_fVlU1FwP4[youtube, width=640, height=360, align="center"] == Frequently asked questions === Why does Blue Ocean exist? The DevOps world has transitioned from developer tools that are purely functional, to developer tools being part of a "developer experience." It was no longer about a single tool, but the many tools developers use throughout the day, and how they work together to achieve a better workflow for the developer. Developer tool companies like Heroku, Atlassian, and GitHub have raised the bar for what is considered a good developer experience. Gradually, developers have become more attracted to tools that are not only functional, but are designed to fit into their existing workflow seamlessly. This shift represents a higher standard for design and function, where developers are expecting an exceptional user experience. Jenkins needed to rise to meet this higher standard. Creating and visualising continuous delivery Pipelines has always been something valuable for many Jenkins users. This has been demonstrated in the plugins that the Jenkins community has created to meet their needs. This also indicates a need to revisit how Jenkins currently expresses these concepts, and consider delivery pipelines as a central theme to the Jenkins user experience. It is not just continuous delivery concepts, but the tools that developers use every day such as GitHub, | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/index.adoc | main | jenkins | [
-0.015112947672605515,
-0.0449993871152401,
-0.038176536560058594,
-0.013865219429135323,
0.03896547853946686,
-0.06832995265722275,
-0.0030194944702088833,
0.03907831758260727,
-0.016962766647338867,
-0.030925782397389412,
-0.04942813143134117,
-0.0924525037407875,
-0.01189304981380701,
-... | 0.066579 |
has created to meet their needs. This also indicates a need to revisit how Jenkins currently expresses these concepts, and consider delivery pipelines as a central theme to the Jenkins user experience. It is not just continuous delivery concepts, but the tools that developers use every day such as GitHub, Bitbucket, Slack, Puppet, or Docker. It is about more than Jenkins, as it includes the developer workflow surrounding Jenkins, which comprised multiple tools. New teams can encounter challenges when learning how to assemble their own Jenkins experience. However, the goal to improve their time to market by shipping better software more consistently is the same. Assembling the ideal Jenkins experience is something we, as a community of Jenkins users and contributors, can work together to define. As time progresses, developers' expectations of a good user experience change, and the Jenkins project needs to be receptive to these expectations. The Jenkins community has worked constantly to build the most technically capable and extensible software automation tool in existence. Not revolutionizing the Jenkins developer experience today could mean that a closed source option attempts to capitalize on this in the future. Blue Ocean was created to meet such demands of its time. However, as time passed, more modern tools have cropped up to replace it. Now, the time has come for the rise of other plugins of similar functionality. Therefore, any new development or enhancement of Blue Ocean has ceased. If you are interested in contributing to a plugin which serves a similar purpose, you should consider the alternative options as suggested in \*xref:#blue-ocean-overview[What is Blue Ocean?]\* section on above. video::mn61VFdScuk[youtube, width=640, height=360, align="center"] === Where is the name from? The name Blue Ocean comes from the book link:https://en.wikipedia.org/wiki/Blue\_Ocean\_Strategy[Blue Ocean Strategy]. This strategy involves looking at problems in the larger uncontested space, instead of strategic problems within a contested space. To put this more simply, consider this quote from ice hockey legend Wayne Gretzky: "Skate to where the puck is going to be, not where it has been." ==== Does Blue Ocean support freestyle jobs? Blue Ocean aims to deliver a great experience around Pipeline and compatibility with any freestyle jobs you already have configured in your Jenkins controller. However, you will not benefit from the features built for Pipelines, for example Pipeline visualization. Blue Ocean was designed to be extensible, so that the Jenkins community could extend Blue Ocean functionality. While there will not be any further functionalities added to Blue Ocean, it still provides Pipeline visualization and other features that users find valuable. === What does this mean for my plugins? Extensibility is a core feature of Jenkins and being able to extend the Blue Ocean UI is equally important. The `` can be used in the markup of Blue Ocean, leaving places for plugins to contribute to the UI. This means plugins can have their own Blue Ocean extension points. Blue Ocean itself is implemented using these extension points. Extensions are delivered by plugins as usual. Plugins must include some additional JavaScript to connect to Blue Ocean's extension points. Developers that have contributed to the Blue Ocean user experience will have added this JavaScript accordingly. === What technologies are currently in use? Blue Ocean is built as a collection of Jenkins plugins. The key difference is that Blue Ocean provides both its own endpoint for HTTP requests, and it delivers HTML/JavaScript via a different path, without using the existing Jenkins UI markup or scripts. React.js and ES6 are used to deliver the JavaScript components of Blue Ocean. Inspired by this excellent open-source project, which you can refer to in | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/index.adoc | main | jenkins | [
-0.07197729498147964,
-0.03764795511960983,
0.04304630309343338,
0.013883327133953571,
0.017639897763729095,
-0.08230988681316376,
-0.0718986913561821,
0.01376815140247345,
-0.0026332498528063297,
0.0024282385129481554,
-0.0939020961523056,
-0.020433319732546806,
0.05705545097589493,
0.007... | 0.106724 |
provides both its own endpoint for HTTP requests, and it delivers HTML/JavaScript via a different path, without using the existing Jenkins UI markup or scripts. React.js and ES6 are used to deliver the JavaScript components of Blue Ocean. Inspired by this excellent open-source project, which you can refer to in the link:https://nylas.com/blog/react-plugins[building plugins for React apps] blog post, an `` pattern was established that allows extensions to come from any Jenkins plugin with JavaScript. If the extensions fail to load, their failures are isolated. === Where can I find the source code? The source code can be found on Github: \* link:https://github.com/jenkinsci/blueocean-plugin[Blue Ocean] \* link:https://github.com/jenkinsci/jenkins-design-language[Jenkins Design Language] == Join the Blue Ocean community As the development of Blue Ocean has frozen, we do not anticipate or expect any new contributions made to its codebase for new features. However, there are still a few ways you can join the community: . Chat with the community and development team on Gitter image:https://badges.gitter.im/jenkinsci/blueocean-plugin.svg[link="https://app.gitter.im/#/room/#jenkinsci\_blueocean-plugin:gitter.im"] . Request features or report bugs against the link:https://issues.jenkins.io/[`blueocean-plugin` component in JIRA]. . Subscribe and ask questions on the link:https://groups.google.com/g/jenkinsci-users[Jenkins Users mailing list]. . Developer? We've link:https://issues.jenkins.io/issues/?filter=16142[labeled a few issues] that are great for anyone wanting to get started developing Blue Ocean. Don't forget to drop by the Gitter chat and introduce yourself! | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/index.adoc | main | jenkins | [
-0.13409554958343506,
-0.05520213767886162,
0.050165291875600815,
0.04197055846452713,
0.07899858802556992,
-0.016756178811192513,
-0.09830543398857117,
0.003749499097466469,
0.009141056798398495,
-0.04564093425869942,
-0.05729575827717781,
-0.023037174716591835,
-0.02972927875816822,
0.01... | 0.153656 |
= Activity View The Blue Ocean Activity view shows all activities related to one Pipeline. include::partial$blue-ocean-status.adoc[] == Navigation Bar The Activity view includes the xref:getting-started.adoc#navigation-bar[standard navigation bar] at the top and a local navigation bar below it. image::activity/navigation-bars.png[Navigation bars from the Activity view, role=center] The local navigation bar includes: \* \*Pipeline Name\* - Selecting this displays the default Activity tab. \* \*Favorites Toggle\* - Selecting the favorite icon ☆ to the right of the Pipeline name, adds a branch to the favorites list shown on the xref:./dashboard.adoc#favorites-list[dashboard's favorites list]. \* \*Tabs\* (xref:#activity[Activity], xref:#branches[ Branches] xref:#pull-requests[ Pull Requests]) - Selecting one of these navigates to the corresponding information in the Activity view. [#activity] === Activity The default tab of the Activity view shows a list of the latest completed or active runs. Each line represents the xref:./dashboard.adoc#run-status[status] of a run, run ID, commit information, and when the run completed. image::activity/overview.png[Default activity tab view of the Activity view, role=center] \* Selecting a run will bring up the xref:glossary:index.adoc#pipeline[Pipeline run details] to provide Pipeline visualization. \* Active runs can be aborted from this list by selecting the \*stop\* icon, which is represented by a ◾ within a circle. \* Runs that have been completed can be re-run by selecting the \*re-run\* icon ↺. \* The list can be filtered by branch using the "Branch" drop-down in the list header. image::activity/branch-filter.png[Branch filter in Blue Ocean activity view, width=17% role=center] This view does not allow runs to be edited or marked as favorites. To perform these actions, select the \*Branches\* tab. [#branches] === Branches The \*Branches\* tab shows a list of all branches that have a completed or active run in the current Pipeline. Each line in the list corresponds to a branch in source control, displaying the xref:./dashboard.adoc#pipeline-health[overall health of the branch] based on the status of the most recent run, branch name, commit information, and when the run completed. image::activity/branches.png[Branches tab of Activity view, role=center] Selecting a branch brings up the xref:glossary:index.adoc#pipeline[Pipeline run details] for the latest completed or active run of that branch. . Pipelines where the latest run has been completed can be run again by selecting the \*run\* icon, represented by a icon:play[] in a circle. + \* Active runs can be aborted, and display a \*stop\* icon, which is represented by a ◾ within a circle. . Selecting the \*history\* icon icon:history[] allows you to view the run history for that branch. . The \*edit\* icon, represented by a icon:pencil[], opens the Pipeline editor for that branch. . The \*favorite\* ☆ icon adds a branch to your favorites list on the xref:./dashboard.adoc#favorites-list[dashboard]. On the dashboard a branch listed under favorites displays a solid star ★. Deselecting the star removes the branch from the favorites list. [#pull-requests] === Pull Requests The Pull Requests tab displays a list of all pull requests for the current Pipeline, that have a completed or active run. Each line in the list corresponds to a pull request in source control, which displays the status of the most recent run, run ID, summary, author, and when the run completed. image::activity/pull-requests.png[Activity Pull Requests view, role=center] Blue Ocean displays pull requests and branches separately, but the lists behave similarly. Selecting a pull request in this list will bring up the xref:glossary:index.adoc#pipeline[Pipeline run details] for the latest completed or active run of that pull request. \* Active runs can be aborted from this list by selecting the \*stop\* icon, which is represented by a ◾ within a circle. \* Pull requests whose latest run has been completed can be run again by selecting the \*run\* icon, represented by a | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/activity.adoc | main | jenkins | [
0.025641106069087982,
-0.08667785674333572,
-0.0000697718933224678,
-0.02308746986091137,
0.053211793303489685,
0.0008436182397417724,
0.042933739721775055,
0.018856234848499298,
0.005217439029365778,
-0.016948506236076355,
-0.04900014400482178,
-0.0332321971654892,
0.009098070673644543,
-... | 0.00041 |
active run of that pull request. \* Active runs can be aborted from this list by selecting the \*stop\* icon, which is represented by a ◾ within a circle. \* Pull requests whose latest run has been completed can be run again by selecting the \*run\* icon, represented by a icon:play[] in a circle. The pull request list does not display xref:./dashboard.adoc#pipeline-health[health icons], and pull requests cannot be edited or marked as favorites. NOTE: By default, when a pull request is closed, Jenkins removes the Pipeline from Jenkins, and runs for that pull request are no longer accessible from Jenkins. The Pipelines removed in this way will need to be cleaned up in the future. This can be changed by adjusting the configuration of the underlying multi-branch Pipeline job. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/blueocean/pages/activity.adoc | main | jenkins | [
-0.05798560380935669,
-0.03520473837852478,
-0.006228388752788305,
-0.012907001189887524,
0.04901064187288284,
-0.04517979547381401,
-0.03299149125814438,
-0.026415612548589706,
0.014146240428090096,
0.011518261395394802,
-0.034609850496053696,
0.029043836519122124,
-0.08948900550603867,
-... | 0.028951 |
= Scaling Jenkins on Kubernetes == Jenkins Scalability When using the standalone Jenkins server you don’t have to worry about multiple servers and nodes. However, the issue with this setup is that your server can become overloaded with numerous jobs running at the same time. There are ways to solve this problem by increasing the number of executors, but you soon end up hitting a performance limit. To overcome this problem, you can offload some of the jobs to different machines called Jenkins agents. Scalability is a measure that shows the ability of a system to expand its capabilities to handle additional load. One of the strongest sides of Jenkins is that it has a scaling feature out-of-the-box. Jenkins scaling is based on the controller/agents model, where you have a number of agents and one main Jenkins controller that is responsible mainly for distributing jobs across the agents. Jenkins agents run a small program that communicates with the Jenkins controller to check if there’s any job it can run. When Jenkins finds a job scheduled, it transfers the build to the agent. == Scaling Jenkins on Kubernetes Taking it a step further, running a container orchestrator such as Kubernetes, you can make Jenkins do smarter things. The Jenkins controller is responsible for the hosting configuration and the distribution of jobs to multiple agents. However, you don’t need the agents to be preexisting, they can be created on the fly, as in when they’re required. === Advantages of scaling Jenkins on Kubernetes Autohealing is possible:: If your build or your agent gets corrupted, you no longer need to worry — Jenkins will remove the unhealthy instance and spin up a new one. Run builds in parallel:: You no longer have to plan the executors and limit them; instead, Jenkins will spin up an agent instance and run your build in it. Even load distribution:: Kubernetes manages loads well, and it’ll make sure your Jenkins agents spin up in the best available server, which makes your builds faster and more efficient. == Setting Up Scalable Jenkins on Kubernetes === Jenkins Controller Installation To install a Jenkins controller, create your Docker image based on the base Jenkins image, which can be found in the official docker repository (keep in mind that Docker should be installed on your local machine, see the installation steps xref:installing-jenkins:docker.adoc[here]). For this, you need to create a Dockerfile. Having your Jenkins setup as a Dockerfile is highly recommended to make your continuous integration infrastructure replicable and have it ready for setup from scratch. So let’s create our first example Dockerfile for the Jenkins controller: .Dockerfile [source] ---- FROM jenkins/jenkins:lts-slim-jdk21 <1> # Pipelines with Blue Ocean UI and Kubernetes RUN jenkins-plugin-cli --plugins blueocean kubernetes <2> ---- <1> `FROM [image\_name]:[tag]` - this line means that our dockerfile will be based on an existing image. It is obvious that for our dockerfile, we take the Jenkins base image, which you can find in the link:https://hub.docker.com/r/jenkins/jenkins[official Docker repository]. <2> `RUN [command]` - this line means that we are going to run this command inside the image during the build process. In our case we use the `RUN` command to install different common Jenkins plugins, which can be required for your Jenkins controller. You can install additional plugins just by adding similar commands inside your dockerfile like we did above. However, one of the plugins above is critical for installation. It is the {plugin}kubernetes[Kubernetes plugin]. This plugin is designed to implement Jenkins scaling on top of a Kubernetes cluster. Next, we need to build the image that can be used and run inside the | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/scaling-jenkins-on-kubernetes.adoc | main | jenkins | [
0.0015217227628454566,
0.003163867862895131,
0.01078841369599104,
0.04191914200782776,
-0.031926367431879044,
-0.053762342780828476,
-0.08004219084978104,
-0.014280232600867748,
0.07226292788982391,
-0.007745382841676474,
-0.0766402930021286,
-0.03255579248070717,
0.002828278811648488,
-0.... | 0.115949 |
your dockerfile like we did above. However, one of the plugins above is critical for installation. It is the {plugin}kubernetes[Kubernetes plugin]. This plugin is designed to implement Jenkins scaling on top of a Kubernetes cluster. Next, we need to build the image that can be used and run inside the Kubernetes cluster later on. TIP: Before building the image, if you use Minikube, then you need to keep in mind that Minikube runs on your local machine but inside a virtual machine. That’s why Minikube doesn’t see the Docker images you created on your local machine. You can build your Docker image right inside your Minikube virtual machine, but for this you need to execute this command: [source,bash] ---- eval $(minikube docker-env) ---- This command doesn’t show any output after execution so if you didn’t get any errors then everything should be fine. To build a Docker image based on the Dockerfile you created, all you need is to run this command from the same folder where you have created the Dockerfile: [source,bash] ---- docker build -t my-jenkins-image:1.1 . ---- After the build process is finished, let’s verify that the newly created image is there: [source,bash] ---- docker images REPOSITORY TAG IMAGE ID CREATED SIZE my-jenkins-image 1.1 d6e46aa2470d 10 minutes ago 969MB ---- Congratulations! Your Jenkins controller image is created and can be used inside your Kubernetes cluster. === Deploy Jenkins Controller After successfully creating your Jenkins image, follow the steps explained in the xref:installing-jenkins:kubernetes.adoc[Jenkins installation doc] to deploy your Jenkins controller. [NOTE] ==== Ensure to replace the image in the `jenkins-deployment.yaml` file with your locally built image above. ==== To validate that creating the deployment was successful you can invoke: [source,bash] ---- kubectl get deployments -n jenkins ---- To validate that creating the service was successful you can run: [source,bash] ---- kubectl get services -n jenkins NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE jenkins NodePort 10.103.31.217 8080:32664/TCP 59s ---- === Access Jenkins dashboard So now we have created a deployment and service, how do we access our Jenkins controller? From the output above we can see that the service has been exposed on port `32664`. In addition to that, we need to know the IP of the Kubernetes cluster itself. We can get it by using this command: [source,bash] ---- minikube ip 192.168.99.100 ---- Now we can access the Jenkins controller at \http://192.168.99.100:32664/ == Jenkins Agents Configuration Now it’s time to configure Jenkins agents. As you might remember, we installed the Kubernetes plugin using the controller dockerfile so we don’t need to install anything separately and the required plugin should be already there. In order to configure the Jenkins agents. We need to know the URL of the Kubernetes controller and the internal cluster URL of the Jenkins pod. You can get the Kubernetes controller URL by this specified command: [source,bash] ---- kubectl cluster-info Kubernetes control plane is running at https://192.168.49.2:8443 KubeDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. ---- The Jenkins pod URL port is standard - `8080`, and you can get IP address following the steps below. First, we need to get the Jenkins pod id, which is the value of the output provided by this command: [source,bash] ---- kubectl get pods -n jenkins | grep jenkins 1/1 Running 0 9m ---- Second, we need to run the command that describes the pods passing the pod id as an argument. You will find the IP address in the output: [source,bash] ---- kubectl describe pod -n jenkins jenkins-5fdbf5d7c5-dj2rq ….. IP: 172.17.0.4 ---- === Kubernetes Plugin Configuration Now, we are ready to | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/scaling-jenkins-on-kubernetes.adoc | main | jenkins | [
0.0480320043861866,
0.07202786207199097,
0.007272282149642706,
-0.015999404713511467,
0.061439428478479385,
-0.002083525061607361,
-0.052931658923625946,
0.05979689210653305,
0.03266583010554314,
0.03774407505989075,
-0.07286970317363739,
-0.09426836669445038,
0.04234973341226578,
-0.00538... | -0.067076 |
9m ---- Second, we need to run the command that describes the pods passing the pod id as an argument. You will find the IP address in the output: [source,bash] ---- kubectl describe pod -n jenkins jenkins-5fdbf5d7c5-dj2rq ….. IP: 172.17.0.4 ---- === Kubernetes Plugin Configuration Now, we are ready to fill in the Kubernetes plugin configuration. In order to do that, open the Jenkins UI and navigate to “Manage Jenkins -> Nodes and Clouds -> Clouds -> Add a new cloud -> Kubernetes and fill in the `Kubernetes URL` and `Jenkins URL` appropriately, by using the values which we have just collected in the previous step. image::kubernetes-plugin-configuration.png[kubernetes-plugin-configuration] In addition to that, in the `Kubernetes Pod Template` section, we need to configure the image that will be used to spin up the agents. If you have some custom requirements for your agents, you can build one more dockerfile with the appropriate changes the same way we did for the Jenkins controller. On the other hand, if you don’t have unique requirements for your agents, you can use the default Jenkins agents image available on the link:https://hub.docker.com/r/jenkins/inbound-agent/[official Docker hub repository]. In the ‘Kubernetes Pod Template’ section you need to specify the following (the rest of the configuration is up to you): Kubernetes Pod Template Name - can be any and will be shown as a prefix for unique generated agents' names, which will be run automatically during builds Docker image - the docker image name that will be used as a reference to spin up a new Jenkins agents. image::pod-template-configuration.png[pod-template-configuration] == Using Jenkins Agents Now all the configuration seems to be in place and we are ready for some tests. Let’s create two different build plans. image::build-jobs.png[image] Now let’s trigger the execution for both of the builds. You should see that both build plans appear in the `Build Queue` box almost immediately. If you applied the correct configuration in the previous steps, you should see that you have two additional executors and both have the prefix `jenkins-agent`, in about 10-15 seconds. This means that these nodes were automatically launched inside the Kubernetes cluster by using the Jenkins Kubernetes plugin, and, most importantly, that they were run in parallel. You can also confirm this from the Kubernetes dashboard, which will show you a couple of new pods. After both builds are completed, you should see that both build executors have been removed and are not available inside the cluster anymore. Congratulations! We've successfully set up scalable Jenkins on top of a Kubernetes cluster. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/scaling-jenkins-on-kubernetes.adoc | main | jenkins | [
0.02094755880534649,
0.012743850238621235,
0.018180664628744125,
-0.021031036972999573,
-0.017848249524831772,
0.021404683589935303,
-0.023258868604898453,
-0.0461781844496727,
0.04429591819643974,
0.07125938683748245,
-0.061968185007572174,
-0.06431351602077484,
0.011243176646530628,
-0.0... | 0.068162 |
= Architecting for Scale == Introduction As an organization matures from a continuous delivery standpoint, its Jenkins requirements will similarly grow. This growth is often reflected in the Jenkins architecture, whether that be "vertical" or "horizontal" growth. \*Vertical growth\* is when the load on a Jenkins controller load is increased by having more configured jobs or orchestrating more frequent builds. This may also mean that more teams are depending on that one controller. \*Horizontal\* growth is the creation of additional Jenkins controllers to accommodate new teams or projects, rather than adding new teams or projects to an existing controller. There are potential pitfalls associated with each approach to scaling Jenkins, but with careful planning, many of them can be avoided or managed. Here are some things to consider when choosing a strategy for scaling your organization's Jenkins controllers: \* \*\*Do you have the resources to run a distributed build system?\*\* If possible, it is recommended set up dedicated build nodes that run separately from the Jenkins controller. This frees up resources for the controller to improve its scheduling performance and prevents builds from being able to modify any potentially sensitive data in the \_$JENKINS\_HOME\_. This also allows for a single controller to scale far more vertically than if that controller were both the job builder and scheduler. \* \*\*Do you have the resources to maintain multiple controllers?\*\* Jenkins controllers require regular plugin updates, semi-monthly core upgrades, and regular backups of configurations and build histories. Security settings and roles will have to be manually configured for each controller. Downed controllers will require manual restart of the Jenkins controller and any jobs that were killed by the outage. \* \*\*How mission critical are each team's projects?\*\* Consider segregating the most vital projects to separate controllers to minimize the impact of a single downed controller. Also consider converting any mission-critical project pipelines to Pipeline jobs, which continue executing even when the agent connection to the controller is lost. \* \*\*How important is a fast start-up time for your Jenkins controller?\*\* The more jobs a controller has configured, the longer it takes to load Jenkins after an upgrade or a crash. The use of folders and views to organize jobs can limit the number of that need to be rendered on start up. [#distributed-builds-architecture] == Distributed Builds Architecture A Jenkins controller can operate by itself both managing the build environment and executing the builds with its own executors and resources. If you stick with this "standalone" configuration you will most likely run out of resources when the number or the load of your projects increase. To come back up and running with your Jenkins infrastructure you will need to enhance the controller (increasing memory, number of CPUs, etc). The time it takes to maintain and upgrade the machine, the controller together with all the build environment will be down, the jobs will be stopped and the whole Jenkins infrastructure will be unusable. Scaling Jenkins in such a scenario would be extremely painful and would introduce many "idle" periods where all the resources assigned to your build environment are useless. Moreover, executing jobs on the controller introduces a "security" issue: the "jenkins" user that Jenkins uses to run the jobs would have full permissions on all Jenkins resources on the controller. This means that, with a simple script, a malicious user can have direct access to private information whose integrity and privacy could not be, thus, guaranteed. See xref:user-docs:security:controller-isolation.adoc[Distributed Builds] in the xref:dev-docs:security:index.adoc[Securing Jenkins] chapter for more information. For all these reasons Jenkins supports agents, where the workload of building projects are delegated to multiple | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-scale.adoc | main | jenkins | [
-0.027547473087906837,
0.008307457901537418,
-0.04454786330461502,
0.01215120404958725,
-0.06357641518115997,
-0.03192692995071411,
-0.11264041066169739,
0.03308343142271042,
0.04003625735640526,
0.026057707145810127,
-0.023482535034418106,
-0.017750654369592667,
0.04478949308395386,
0.001... | 0.083971 |
a simple script, a malicious user can have direct access to private information whose integrity and privacy could not be, thus, guaranteed. See xref:user-docs:security:controller-isolation.adoc[Distributed Builds] in the xref:dev-docs:security:index.adoc[Securing Jenkins] chapter for more information. For all these reasons Jenkins supports agents, where the workload of building projects are delegated to multiple agents. An agent is a machine set up to offload projects from the controller. The method with which builds are scheduled depends on the configuration given to each project. For example, some projects may be configured to "restrict where this project is run" which ties the project to a specific agent or set of labeled agents. Other projects which omit this configuration will select an agent from the available pool in Jenkins. Learn more about Agents in xref:managing:nodes.adoc#creating-agents[Managing Nodes] In a distributed builds environment, the Jenkins controller will use its resources to only handle HTTP requests and manage the build environment. Actual execution of builds will be delegated to the agents. With this configuration it is possible to horizontally scale an architecture, which allows a single Jenkins installation to host a large number of projects and build environments. === Agent communications In order for a machine to be recognized as an agent, it needs to run a specific agent program to establish bi-directional communication with the controller. There are different ways to establish a connection between controller and agent: //// TODO: The terminology used in these two bullet points needs to be synchronised with the actual Jenkins interface terminology //// \* \*The SSH connector\*: Configuring an agent to use the SSH connector is the preferred and the most stable way to establish controller-agent communication. Jenkins has a built-in SSH client implementation. This means that the Jenkins controller can easily communicate with any machine with an SSH server installed. The only requirement is that the public key of the controller is part of the set of the authorized keys on the agent. Once the host and SSH key is defined for a new agent, Jenkins will establish a connection to the machine and bootstrap the agent process. //// TODO: This whole bullet point/section needs to be rewritten to be more clearly structured also terminology here is old (s/JNLP/inbound/g), and WebSocket should be mentioned //// \* \*The inbound connector\*: In this case the communication is established starting the agent through a connection initiated by an agent program. With this connector the agent is launched in the machine in 2 different ways: . Manually: by navigating to the Jenkins controller URL in a browser on the agent. Once the Java Web Start icon is clicked, the agent will be launched on the machine. The downside of this approach is that the agents cannot be centrally managed by the Jenkins controller and each/stop/start/update of the agent needs to be executed manually on the agent's machine in versions of Jenkins older than 1.611. This approach is convenient when the controller cannot instantiate the connection with the client, for example: with agents running inside a firewalled network connecting to a controller located outside the firewall. . As a service: First you'll need to manually launch the agent using the above method. After manually launching it, \_jenkins-slave.exe\_ and \_jenkins-slave.xml\_ will be created in the agent's work directory. Now go to the command line to execute the following command: //// TODO: This section on windows JNLP connection is not being indented or grouped properly //// [source, width="300"] ---- sc.exe create "" start= auto binPath= "" DisplayName= "" ---- \_\_ is the name of the registry key to define this agent service and is the label that will identify | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-scale.adoc | main | jenkins | [
-0.031322892755270004,
-0.02449178881943226,
-0.07756205648183823,
0.0063516017980873585,
0.0621509775519371,
-0.06600569933652878,
0.03518981859087944,
-0.026356970891356468,
0.07768767327070236,
-0.017013585194945335,
-0.016103804111480713,
0.011948003433644772,
0.042432647198438644,
-0.... | 0.123002 |
command: //// TODO: This section on windows JNLP connection is not being indented or grouped properly //// [source, width="300"] ---- sc.exe create "" start= auto binPath= "" DisplayName= "" ---- \_\_ is the name of the registry key to define this agent service and is the label that will identify the service in the Service Manager interface. To ensure that restarts are automated, you will need to download a recent agent jar and copy it to a permanent location on the machine. The\_.jar\_ file can be found at: [source, width="350"] ---- http:///jnlpJars/agent.jar ---- If running a version of Jenkins newer than 1.559, the \_.jar\_ will be kept up to date each time it connects to the controller. \* \*The Inbound-HTTP connector\*: This approach is quite similar to the Inbound-TCP Java Web Start approach, with the difference in this case being that the agent is executed as headless and the connection can be tunneled via HTTP(s). The exact command can be found on your Inbound agent's configuration page: [#inbound\_agent] .Inbound agent launch command image::user-docs:scaling:inbound-agent.png[Inbound agent node screen, scaledwidth=90%] This approach is convenient for an execution as a daemon on Unix. \* \*Custom-script\*: It is also possible to create a custom script to initialize the communication between controller and agent if the other solutions do not provide enough flexibility for a specific use-case. The only requirement is that the script runs the java program as a \_java -jar agent.jar\_ on the agent. Windows agent set-up can follow the standard SSH and inbound agent approaches. Windows agents have the following options: \* \*SSH-connector approach with Putty\* \* \*SSH-connector approach with Cygwin and OpenSSH\*: https://wiki.jenkins.io/display/JENKINS/SSH+slaves+and+Cygwin[This] is the easiest to setup and recommended approach. \* \*SSH-connector approach with Microsoft OpenSSH\*: The link:https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh\_install\_firstuse[Microsoft OpenSSH server] works well for Microsoft operating systems that support the server. Refer to installation instructions in the link:https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/CONFIGURE.md#launch-windows-agents-using-microsoft-openssh[ssh build agents configuration guide]. \* \*Inbound agent approach\*: With https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+as+a+Windows+service[this approach] it is possible to manually register the agent as Windows service, but it will not be possible to centrally manage it from the controller. Each stop/start/update of the agent needs to be executed manually on the agent machine, unless running Jenkins 1.611 or newer. == Creating fungible agents === Configuring tools location on agents The Jenkins Global configuration page lets you specify the tools needed during the builds (i.e. Ant, Maven, Java, etc). When defining a tool, it is possible to create a pointer to an existing installation by giving the directory where the program is expected to be on the agent. Another option is to let Jenkins take care of the installation of a specific version in the given location. It is also possible to specify more than one installation for the same tool since different jobs may need different versions of the same tool. The pre-compiled "Default" option calls whatever is already installed on the agent and exists in the machine PATH, but this returns a failure if the tool is not installed and its location was not added to the PATH system variable. One best practice to avoid this failure is to configure a job with the assumption that the target agent does not have the necessary tools installed, and to include the tools' installation as part of the build process. === Define a policy to share agent machines As mentioned previously, agents should be interchangeable and standardized in order to make them sharable and to optimize resource usage. Agents should not be customized for a particular set of jobs, nor for a particular team. Lately Jenkins has become more and more popular not only in CI but also in | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-scale.adoc | main | jenkins | [
-0.1093466579914093,
-0.002900392049923539,
-0.028858166188001633,
-0.05397263541817665,
-0.010254690423607826,
0.06286072731018066,
0.00018621610070113093,
-0.011085791513323784,
0.014952778816223145,
0.03868834674358368,
-0.05258876457810402,
0.004290072713047266,
-0.03487369045615196,
0... | 0.102234 |
mentioned previously, agents should be interchangeable and standardized in order to make them sharable and to optimize resource usage. Agents should not be customized for a particular set of jobs, nor for a particular team. Lately Jenkins has become more and more popular not only in CI but also in CD, which means that it must orchestrate jobs and pipelines which involve different teams and technical profiles: developers, QA people and Dev-Ops people. In such a scenario, it might make sense to create customized and dedicated agents: different tools are usually required by different teams (i.e. Puppet/Chef for the Ops team) and teams' credentials are usually stored on the agent in order to ensure their protection and privacy. In order to ensure the execution of a job on a single/group of agents only (i.e. iOS builds on OSX agents only), it is possible to tie the job to the agent by specifying the agent's label in the job configuration page. Note that the restriction has to be replicated in every single job to be tied and that the agent won't be protected from being used by other teams. === Setting up cloud agents Cloud build resources can be a solution for a case when it is necessary to maintain a reasonably small cluster of agents on-premises while still providing new build resources when needed. In particular it is possible to offload the execution of the jobs to agents in the cloud thanks to ad-hoc plugins which will handle the creation of the cloud resources together with their destruction when they are not needed anymore: \* The {plugin}ec2[EC2 Plugin] lets Jenkins use AWS EC2 instances as cloud build resources when it runs out of on-premises agents. The EC2 agents will be dynamically created inside an AWS network and de-provisioned when they are not needed. \* The {plugin}azure-vm-agents[Azure VM Agents Plugin] dynamically spins up Jenkins agents as Azure VMs per user provided configuration via templates, including support for virtual network integration and subnet placement. Idle agents can be configured for automatic shutdown to reduce costs. \* The {plugin}jclouds-jenkins[JCloud plugin] creates the possibility of executing the jobs on any cloud provider supported by JCloud libraries [#right-sizing-jenkins-masters] == Right-sizing Jenkins controllers Comprehensive hardware recommendations: \* Hardware: see the user-docs:scaling:hardware-recommendations.adoc#hardware-recommendations[Hardware Recommendations] page [#master-division-strategies] === Controller division strategies Designing the best Jenkins architecture for your organization is dependent on how you stratify the development of your projects and can be constrained by limitations of the existing Jenkins plugins. The 3 most common forms of stratifying development by controllers is: 1. \*\*By environment (QA, DEV, etc)\*\* - With this strategy, Jenkins controllers are populated by jobs based on what environment they are deploying to. \* \*\*Pros\*\* \*\* Can tailor plugins on controllers to be specific to that environment's needs \*\* Can easily restrict access to an environment to only users who will be using that environment \* \*\*Cons\*\* \*\* Reduces ability to create pipelines \*\* No way to visualize the complete flow across controllers \*\* Outage of a controller will block flow of all products 2. \*\*By org chart\*\* - This strategy is when controllers are assigned to divisions within an organization. \* \*\*Pros\*\* \*\* Can tailor plugins on controllers to be specific to that team's needs \*\* Can easily restrict access to a division's projects to only users who are within that division \* \*\*Cons\*\* \*\* Reduces ability to create cross-division pipelines \*\* No way to visualize the complete flow across controllers \*\* Outage of a controller will block flow of all products 3. \*\*Group controllers by product lines\*\* - When a group of products, with | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-scale.adoc | main | jenkins | [
-0.055025987327098846,
-0.024860253557562828,
-0.060854215174913406,
-0.024975847452878952,
-0.02311057783663273,
-0.017505576834082603,
-0.0014764030929654837,
-0.06224175915122032,
0.07544675469398499,
-0.010300283320248127,
-0.05072277411818504,
-0.013362482190132141,
0.06531821936368942,... | 0.130429 |
only users who are within that division \* \*\*Cons\*\* \*\* Reduces ability to create cross-division pipelines \*\* No way to visualize the complete flow across controllers \*\* Outage of a controller will block flow of all products 3. \*\*Group controllers by product lines\*\* - When a group of products, with on only critical product in each group, gets its own Jenkins controllers. \* \*\*Pros\*\* \*\* Entire flows can be visualized because all steps are on one controller \*\* Reduces the impact of one controller's downtime on only affects a small subset of products \* \*\*Cons\*\* \*\* A strategy for restricting permissions must be devised to keep all users from having access to all items on a controller. When evaluating these strategies, it is important to weigh them against the vertical and horizontal scaling pitfalls discussed in the introduction. Another note is that a smaller number of jobs translates to faster recovery from failures and more importantly a higher mean time between failures. [#Calculating-how-many-jobs,-masters,-and-executors-are-needed] === Calculating how many jobs, controllers, and executors are needed Having the best possible estimate of necessary configurations for a Jenkins installation allows an organization to get started on the right foot with Jenkins and reduces the number of configuration iterations needed to achieve an optimal installation. The challenge for Jenkins architects is that true limit of vertical scaling on a Jenkins controller is constrained by whatever hardware is in place for the controller, as well as harder to quantify pieces like the types of builds and tests that will be run on the build nodes. There is a way to estimate roughly how many controllers, jobs and executors will be needed based on build needs and number of developers served. These equations assume that the Jenkins controller will have 5 cores with one core per 100 jobs (500 total jobs/controller) and that teams will be divided into groups of 40. If you have information on the actual number of available cores on your planned controller, you can make adjustments to the "number of controllers" equations accordingly. The equation for \*estimating the number of controllers and executors needed\* when the number of configured jobs is known is as follows: [source, width="350"] ---- controllers = number of jobs/500 executors = number of jobs \* 0.03 ---- The equation for \*estimating the maximum number of jobs, controllers, and executors needed\* for an organization based on the number of developers is as follows: [source, width="350"] ---- number of jobs = number of developers \* 3.333 number of controllers = number of jobs/500 number of executors = number of jobs \* 0.03 ---- These numbers will provide a good starting point for a Jenkins installation, but adjustments to actual installation size may be needed based on the types of builds and tests that an installation runs. [#scalable-storage-for-master] === Scalable storage for controllers It is also recommended to choose a controller with consideration for future growth in the number of plugins or jobs stored in your controller's \_$JENKINS\_HOME\_. Storage is cheap and Jenkins does not require fast disk access to run well, so it is more advantageous to invest in a larger machine for your controller over a faster one. Different operating systems for the Jenkins controller will also allow for different approaches to expandable storage: \* \*Spanned Volumes on Windows\* - On NTFS devices like Windows, you can create a spanned volume that allows you to add new volumes to an existing one, but have them behave as a single volume. To do this, you will have to ensure that Jenkins is installed on a separate partition so that it can | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-scale.adoc | main | jenkins | [
-0.03567944094538689,
-0.006692275404930115,
-0.045515671372413635,
-0.03905812278389931,
0.07831224054098129,
-0.016214776784181595,
-0.014565156772732735,
0.0014778790064156055,
0.014910961501300335,
-0.002449458697810769,
-0.0053808181546628475,
0.02903071977198124,
0.005791583564132452,
... | 0.093555 |
On NTFS devices like Windows, you can create a spanned volume that allows you to add new volumes to an existing one, but have them behave as a single volume. To do this, you will have to ensure that Jenkins is installed on a separate partition so that it can be converted to a spanned volume later. \* \*Logical Volume Manager for Linux\* - LVM manages disk drives and allows logical volumes to be resized on the fly. Many distributions of Linux use LVM when they are installed, but Jenkins should have its own LVM setup. \* \*ZFS for Solaris\* - ZFS is even more flexible than LVM and spanned volumes and just requires that the \_$JENKINS\_HOME\_ be on its own filesystem. This makes it easier to create snapshots, backups, etc. - For systems with an existing Jenkins installation, there are at least two options: \*\* The System Property xref:managing:system-properties.adoc#jenkins-model-jenkins-buildsdir[jenkins.model.Jenkins.buildsDir] \*\* \*Symbolic Links\* (symlinks) may be used instead to store job folders on separate volumes with symlinks to those directories. Additionally, to easily prevent a \_$JENKINS\_HOME\_ folder from becoming bloated, make it mandatory for jobs to discard build records after a specific time period has passed and/or after a specific number of builds have been run. This policy can be set on a job's configuration page. == Setting up a backup policy It is a best practice to take regular backups of your $JENKINS\_HOME. A backup ensures that your Jenkins controller can be restored despite a misconfiguration, accidental job deletion, or data corruption. See the xref:system-administration:backing-up.adoc[Backup policies] for more details. === Finding your $JENKINS\_HOME \*\*Windows\*\* If you install Jenkins with the Windows installer, Jenkins is installed as a service and the default \_$JENKINS\_HOME\_ will be "C:\Program Files (x86)\jenkins". You can edit the location of your \_$JENKINS\_HOME\_ by opening the jenkins.xml file and editing the \_$JENKINS\_HOME\_ variable, or going to the "Manage Jenkins" screen, clicking on the "Install as Windows Service" option in the menu, and then editing the "Installation Directory" field to point to another existing directory. \*\*Mac OSX\*\* If you install Jenkins with the OS X installer, you can find and edit the location of your \_$JENKINS\_HOME\_ by editing the "Macintosh HD/Library/LaunchDaemons" file's \_$JENKINS\_HOME\_ property. By default, the \_$JENKINS\_HOME\_ will be set to "Macintosh HD/Users/Shared/Jenkins". \*\*Linux\*\* By default, `$JENKINS\_HOME` is set to `/var/lib/jenkins` and `$JENKINS\_WAR` is set to `/usr/share/java/jenkins.war`. You can edit the location of `$JENKINS\_HOME` by running `systemctl edit jenkins` and adding the following: [source] ---- [Service] Environment="HOME=/var/lib/jenkins" Environment="JENKINS\_HOME=/var/lib/jenkins" WorkingDirectory=/var/lib/jenkins ---- You can edit the location of `$JENKINS\_WAR` by running `systemctl edit jenkins` and adding the following: [source] ---- [Service] Environment="JENKINS\_WAR=/usr/share/java/jenkins.war" ---- \*\*FreeBSD\*\* If installing Jenkins using a port, the \_$JENKINS\_HOME\_ will be located in whichever directory you run the "make" command in. It is recommended to create a "/usr/ports/devel/jenkins" folder and compile Jenkins in that directory. You will be able to edit the \_$JENKINS\_HOME\_ by editing the "/usr/local/etc/jenkins". \*\*OpenBSD\*\* If installing Jenkins using a package,the \_$JENKINS\_HOME\_ is set by default to "/var/jenkins". If installing Jenkins using a port, the \_$JENKINS\_HOME\_ will be located in whichever directory you run the "make" command in. It is recommended to create a "/usr/ports/devel/jenkins" folder and compile Jenkins in that directory. You will be able to edit the \_$JENKINS\_HOME\_ by editing the "/usr/local/etc/jenkins" file. \*\*Solaris/OpenIndiana\*\* The Jenkins project voted on September 17, 2014 to discontinue Solaris packages. === Anatomy of a $JENKINS\_HOME The folder structure for a \_$JENKINS\_HOME\_ directory is as follows: [source] ---- JENKINS\_HOME +- config.xml (Jenkins root configuration file) +- \*.xml (other site-wide configuration files) +- identity.key (RSA key pair that identifies an instance) +- secret.key (deprecated key used for | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-scale.adoc | main | jenkins | [
-0.023586224764585495,
-0.015535998158156872,
-0.02429616078734398,
0.03221903368830681,
0.05744986608624458,
-0.07952170073986053,
-0.0753452405333519,
-0.008979562669992447,
0.04507388547062874,
0.02212410978972912,
-0.06875912845134735,
-0.01310728956013918,
0.06637035310268402,
0.01581... | 0.041599 |
2014 to discontinue Solaris packages. === Anatomy of a $JENKINS\_HOME The folder structure for a \_$JENKINS\_HOME\_ directory is as follows: [source] ---- JENKINS\_HOME +- config.xml (Jenkins root configuration file) +- \*.xml (other site-wide configuration files) +- identity.key (RSA key pair that identifies an instance) +- secret.key (deprecated key used for some plugins' secure operations) +- secret.key.not-so-secret (used for validating \_$JENKINS\_HOME\_ creation date) +- userContent (files served under your https://server/userContent/) +- secrets (root directory for the secret+key for credential decryption) +- hudson.util.Secret (used for encrypting some Jenkins data) +- master.key (used for encrypting the hudson.util.Secret key) +- InstanceIdentity.KEY (used to identity this instance) +- fingerprints (stores fingerprint records, if any) +- plugins (root directory for all Jenkins plugins) +- [PLUGINNAME] (sub directory for each plugin) +- META-INF (subdirectory for plugin manifest + pom.xml) +- WEB-INF (subdirectory for plugin jar(s) and licenses.xml) +- [PLUGINNAME].jpi (.jpi or .hpi file for the plugin) +- jobs (root directory for all Jenkins jobs) +- [JOBNAME] (sub directory for each job) +- config.xml (job configuration file) +- workspace (working directory for the version control system) +- latest (symbolic link to the last successful build) +- builds (stores past build records) +- [BUILD\_ID] (subdirectory for each build) +- build.xml (build result summary) +- log (log file) +- changelog.xml (change log) +- [FOLDERNAME] (sub directory for each folder) +- config.xml (folder configuration file) +- jobs (sub directory for all nested jobs) ---- [#segrate-data] ==== Segregating pure configuration from less durable data CAUTION: No data migration is handled by Jenkins when using those settings. So you either want to use them from the beginning, or make sure you take into consideration which data you would like to be moved to the right place before using the following switches. It is possible to separate customize some of the layout to better separate pure job configurations from less durable data, like build data or logs. footnote:[These switches are used to configure out of the box link:https://www.jenkins.io/blog/2018/04/06/jenkins-essentials/[Jenkins Essentials] instances.] ===== Configure a different \_jobs build data\_ layout Historically, the configuration of a given job is located under `$JENKINS\_HOME/jobs/[JOB\_NAME]/config.xml` and its builds are under `$JENKINS\_HOME/jobs/[JOB\_NAME]/builds`. This typically makes it more impractical to set up a different backup policy, or set up a quicker disk for making builds potentially faster. For instance, if you would like to move builds under a different root, you can use the following value: `+$JENKINS\_VAR/${ITEM\_FULL\_NAME}/builds+`. Note that starting with Jenkins 2.119, the User Interface for this was replaced by the `jenkins.model.Jenkins.buildsDir` system property. See the xref:managing:system-properties.adoc[dedicated \_Features Controlled with System Properties\_ wiki page] for more details. //// NOT documenting the other jenkins.model.Jenkins.workspacesDir property on purpose, as this should generally not be used. Using it means one would build on the controller, which we clearly do not want to encourage. //// === Choosing a backup strategy All of your Jenkins-specific configurations that need to be backed up will live in the \_$JENKINS\_HOME\_, but it is a best practice to back up only a subset of those files and folders. Below are a few guidelines to consider when planning your backup strategy. .Exclusions When it comes to creating a backup, it is recommended to exclude archiving the following folders to reduce the size of your backup: [literal] /war (the exploded Jenkins war directory) /cache (downloaded tools) /tools (extracted tools) These folders will automatically be recreated the next time a build runs or Jenkins is launched. .Jobs and Folders Your job or folder configurations, build histories, archived artifacts, and workspace will exist entirely within the \_jobs\_ folder. The \_jobs\_ directory, whether nested within a folder or at the root level is as follows: | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-scale.adoc | main | jenkins | [
-0.05537019670009613,
0.0640667974948883,
-0.047941096127033234,
-0.03245431184768677,
0.054799120873212814,
-0.060720957815647125,
0.026722026988863945,
-0.05317918583750725,
0.04189710691571236,
0.026126019656658173,
0.042628850787878036,
-0.012453807517886162,
0.01455236691981554,
-0.00... | 0.053116 |
automatically be recreated the next time a build runs or Jenkins is launched. .Jobs and Folders Your job or folder configurations, build histories, archived artifacts, and workspace will exist entirely within the \_jobs\_ folder. The \_jobs\_ directory, whether nested within a folder or at the root level is as follows: [source] ---- +- jobs (root directory for all Jenkins jobs) +- [JOBNAME] (sub directory for each job) +- config.xml (job configuration file) +- workspace (working directory for the version control system) +- latest (symbolic link to the last successful build) +- builds (stores past build records) +- [BUILD\_ID] (subdirectory for each build) +- build.xml (build result summary) +- log (log file) +- changelog.xml (change log) ---- If you only need to backup your job configurations, you can opt to only backup the \_config.xml\_ for each job. Generally build records and workspaces do not need to be backed up, as workspaces will be re-created when a job is run and build records are only as important as your organizations deems them. .System configurations Your controller's system configurations exist in the root level of the \_$JENKINS\_HOME\_ folder: [literal] +- config.xml (Jenkins root configuration file) +- \*.xml (other site-wide configuration files) The \_config.xml\_ is the root configuration file for your Jenkins. It includes configurations for the paths of installed tools, workspace directory, and agent port. Any .xml other than that \_config.xml\_ in the root Jenkins folder is a global configuration file for an installed tool or plugin (i.e. Maven, Git, Ant, etc). This includes the \_credentials.xml\_ if the Credentials plugin is installed. If you only want to backup your core Jenkins configuration, you only need to back up the \_config.xml\_. .Plugins Your deployment's plugin files (.hpi and .jpi) and any of their dependent resources (help files, \_pom.xml\_ files, etc) will exist in the \_plugins\_ folder in $JENKINS\_HOME. [literal] +- plugins (root directory for all Jenkins plugins) +- [PLUGINNAME] (sub directory for each plugin) +- META-INF (subdirectory for plugin manifest + pom.xml) +- WEB-INF (subdirectory for plugin jar(s) and licenses.xml) +- [PLUGINNAME].jpi (.jpi or .hpi file for the plugin) It is recommended to back up the entirety of the plugins folder (.hpi/.jpis + folders). .Other data Other data that you are recommended to back up include the contents of your \_secrets\_ folder, your \_identity.key\_, your \_secret.key\_, and your \_secret.key.not-so-secret\_ file. [literal] +- identity.key (RSA key pair that identifies an instance) +- secret.key (used for various secure Jenkins operations) +- secret.key.not-so-secret (used for validating \_$JENKINS\_HOME\_ creation date) +- userContent (files served in https://server/userContent/) +- secrets (directory for the secret+key decryption) +- hudson.util.Secret (used for encrypting some Jenkins data) +- master.key (used for encrypting the hudson.util.Secret key) +- InstanceIdentity.KEY (used to identity this instance) The \_identity.key\_ is an RSA key pair that identifies and authenticates the current Jenkins controller. The \_secret.key\_ is used to encrypt plugin and other Jenkins data, and to establish a secure connection between a controller and agent. The \_secret.key.not-so-secret\_ file is used to validate when the \_$JENKINS\_HOME\_ was created. It is also meant to be a flag that the secret.key file is a deprecated way of encrypting information. The files in the secrets folder are used by Jenkins to encrypt and decrypt your controller's stored credentials, if any exist. Loss of these files will prevent recovery of any stored credentials. \_hudson.util.Secret\_ is used for encrypting some Jenkins data like the credentials.xml, while the \_master.key\_ is used for encrypting the hudson.util.Secret key. Finally, the \_InstanceIdentity.KEY\_ is used to identity this controller and for producing digital signatures. === Define a Jenkins controller to rollback to In the case of a total machine failure, it | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-scale.adoc | main | jenkins | [
-0.06902600079774857,
-0.055144477635622025,
0.023237761110067368,
0.036028869450092316,
0.025174511596560478,
-0.02003728784620762,
-0.03655168041586876,
-0.06926153600215912,
0.002348693087697029,
-0.0428752675652504,
0.0014385010581463575,
0.03420431911945343,
0.047219350934028625,
-0.0... | -0.013495 |
used for encrypting some Jenkins data like the credentials.xml, while the \_master.key\_ is used for encrypting the hudson.util.Secret key. Finally, the \_InstanceIdentity.KEY\_ is used to identity this controller and for producing digital signatures. === Define a Jenkins controller to rollback to In the case of a total machine failure, it is important to ensure that there is a plan in place to get Jenkins both back online and in its last good state. If a high availability set up has not been enabled and no back up of that controller's filesystem has been taken, then an corruption of a machine running Jenkins means that all historical build data and artifacts, job and system configurations, etc. will be lost and the lost configurations will need to be recreated on a new controller. 1. Backup policy - In addition to creating backups using the previous section's backup guide, it is important to establish a policy for selecting which backup should be used when restoring a downed controller. 2. Restoring from a backup - A plan must be put in place on whether the backup should be restored manually or with scripts when the primary goes down. == Resilient Jenkins Architecture Administrators are constantly adding more and more teams to the software factory, making administrators in the business of making their controllers resilient to failures and scaling them in order to onboard more teams. Adding build nodes to a Jenkins controller while beefing up the machine that runs the Jenkins controller is the typical way to scale Jenkins. Said differently, administrators scale their Jenkins controller vertically. However, there is a limit to how much a controller can be scaled. These limitations are covered in the introduction to this chapter. Ideally, controllers will be set up to automatically recover from failures without human intervention. There are proxy servers monitoring active controllers and re-routing requests to backup controllers if the active controller goes down. There are additional factors that should be reviewed on the path to continuous delivery. These factors include componetizing the application under development, automating the entire pipeline (within reasonable limits) and freeing up contentious resources. .Step 1: Make each controller highly available Each Jenkins controller needs to be set up such that it is part of a Jenkins cluster. A proxy (typically HAProxy or F5) then fronts the primary controller. The proxy's job is to continuously monitor the primary controller and route requests to the backup if the primary goes down. To make the infrastructure more resilient, you can have multiple backup controllers configured. .Step 2: Enable security Set up an authentication realm that Jenkins will use for its user database. TIP: If you are trying to set up a proof-of-concept, it is recommended to use the {plugin}mock-security-realm[Mock Security Realm plugin] for authentication. .Step 3: Add build nodes (agents) to controller Add build servers to your controller to ensure you are conducting actual build execution off of the controller, which is meant to be an orchestration hub, and onto a "dumb" machine with sufficient memory and I/O for a given job or test. .Step 4: Setup a test controller A test controller is typically used to test new plugin updates. When a plugin is ready to be used, it should be installed into the main production update center. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-scale.adoc | main | jenkins | [
-0.09151305258274078,
-0.006428070832043886,
0.005516896955668926,
-0.005963027942925692,
0.01932121254503727,
-0.01748058572411537,
-0.03189163655042648,
-0.03864012286067009,
0.019268961623311043,
-0.012113245204091072,
0.004572646226733923,
0.09590926766395569,
0.04759679362177849,
-0.1... | 0.046323 |
= Hardware Recommendations == Introduction Sizing a Jenkins environment depends on a number of factors, which makes it a very inexact science. Achieving an optimal configuration requires some experience and experimentation. It is, however, possible to make a smart approximation to start - especially when designing with best practices in mind. The following outlines these factors and how you can account for them when sizing your configuration. You are also provided sample configurations and the hardwares behind some of the largest Jenkins installations presented in a Jenkins Scalability Summit. [#choosing-the-right-hardware-for-masters] == Choosing the Right Hardware for Controllers One of the greatest challenges of properly setting up a Jenkins controller is that there is no \_one size fits all\_ answer - the exact specifications of the hardware that you will need will depend heavily on your organization's current and future needs. Your Jenkins controller will be serving HTTP requests and storing all of the important information for your Jenkins controller in its \_$JENKINS\_HOME\_ folder (configurations, build histories and plugins). More information on sizing controllers based on organizational needs can be found in the xref:scaling:architecting-for-scale.adoc[Architecting for Scale] section. [#memory-requirements-for-the-controller] === Memory Requirements for the Controller The amount of memory Jenkins needs is largely dependent on many factors, which is why the RAM allotted for it can range from 200 MB for a small installation to 70+ GB for a single and massive Jenkins controller. However, you should be able to estimate the RAM required based on your project build needs. Each build node connection will take 2-3 threads, which equals about 2 MB or more of memory. You will also need to factor in CPU overhead for Jenkins if there are a lot of users who will be accessing the Jenkins user interface. It is generally a bad practice to allocate executors on a controller, as builds can quickly overload a controller's CPU/memory/etc and crash the controller, causing unnecessary downtime. Instead, it is advisable to set up agents that the Jenkins controller can delegate jobs to, keeping the bulk of the work off of the controller itself. == Choosing the Right Build Machines The backbone of Jenkins is its ability to orchestrate builds, but installations which do not leverage Jenkins' distributed builds architecture are artificially limiting the number of builds that their controllers can orchestrate. More information on xref:scaling:architecting-for-scale.adoc#distributed-builds-architecture[a more distributed architecture] can be found in the xref:scaling:architecting-for-scale.adoc[Architecting for Scale] section. === Requirements for a Machine to be an agent [#fungibility] Agents are typically generic x86 machines with enough memory to run specific build types. The agent's configuration depends on the builds it will be used for and on the tools required by the same builds. Configuring a machine to act as an agent inside your infrastructure can be tedious and time consuming. This is especially true when the same set-up has to be replicated on a large pool of agents. Because of this, is ideal to have fungible agents, which are agents that are easily replaceable. Agents should be generic for all builds rather customized for a specific job or a set of jobs. The more generic the agents, the more easily they are interchanged, which in turn allows for a better use of resources and a reduced impact on productivity if some agents suffer an outage. Andrew Bayer introduced this concept of "fungibility" as applied to agents during his presentation https://www.slideshare.net/andrewbayer/seven-habits-of-highly-effective-jenkins-users-2014-edition["Seven Habits of Highly Effective Jenkins Users" at the Jenkins User Conference (Europe, 2014)]. The more automated the environment configuration is, the easier it is to replicate a configuration onto a new agent machine. Tools for configuration management or a | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/hardware-recommendations.adoc | main | jenkins | [
0.021100874990224838,
0.0125488406047225,
-0.0126015804708004,
0.02508813887834549,
-0.03464328870177269,
-0.041073329746723175,
-0.06249084696173668,
0.08035802841186523,
-0.0458185188472271,
0.00007106068369466811,
-0.07993029057979584,
-0.03375301882624626,
0.01461512129753828,
-0.06659... | 0.014938 |
concept of "fungibility" as applied to agents during his presentation https://www.slideshare.net/andrewbayer/seven-habits-of-highly-effective-jenkins-users-2014-edition["Seven Habits of Highly Effective Jenkins Users" at the Jenkins User Conference (Europe, 2014)]. The more automated the environment configuration is, the easier it is to replicate a configuration onto a new agent machine. Tools for configuration management or a pre-baked image can be excellent solutions to this end. Containers and virtualization are also popular tools for creating generic agent environments. More information on estimating the number of executors needed in a given environment can be found in the xref:scaling:architecting-for-scale.adoc[Architecting for Scale] section. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/hardware-recommendations.adoc | main | jenkins | [
0.03694596886634827,
-0.0255280751734972,
-0.04769689217209816,
-0.0022412105463445187,
-0.0348883718252182,
-0.10493036359548569,
-0.08967246860265732,
0.00009828664042288437,
-0.005336429458111525,
0.0011427364079281688,
-0.04001849144697189,
-0.05667718127369881,
0.049358151853084564,
0... | 0.115325 |
= Scaling Jenkins This chapter covers topics related to using and managing large scale Jenkins configurations: large numbers of users, nodes, agents, folders, projects, concurrent jobs, job results and logs, and even large numbers of Jenkins controllers. The audience for this chapter is expert Jenkins users, administrators, and those planning large-scale installations. If you are a Jenkins administrator and want to know more about managing Jenkins nodes and controllers, see xref:user-docs:managing:index.adoc[Managing Jenkins]. For an overview of content in the Jenkins User Handbook, see xref:user-docs:getting-started:index.adoc[User Handbook Overview]. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/index.adoc | main | jenkins | [
0.02776947245001793,
-0.032408587634563446,
-0.035240061581134796,
0.033038899302482605,
-0.008154500275850296,
-0.08705757558345795,
-0.0316087044775486,
0.025605060160160065,
-0.014604036696255207,
0.050406623631715775,
-0.05043734982609749,
0.057267118245363235,
0.020694147795438766,
-0... | 0.142798 |
= Architecting for Manageability == Introduction With over 2,000 plugins and countless versions of said plugins in the open-source community, testing for all possible conflicts before upgrading one or more production Jenkins controllers is simply not feasible. While Jenkins itself will warn of potential incompatibility if it detects that a plugin requires a newer version of the Jenkins core, there is no automatic way to detect conflicts between plugins or to automatically quantify the impact of upgrading a plugin. Jenkins administrators test plugin and core version updates before performing them on the production controller. This kind of testing requires a copy or "test deployment" of the production server to act as the sandbox for such tests. Effective upgrade testing can prevent production downtime. == Test Controllers A test controller is a Jenkins controller used solely for testing configurations and plugins in a non-production environment. A test controller is highly recommended for organizations with a mission-critical Jenkins controller. Upgrading or downgrading either the Jenkins core or any plugins can sometimes have the unintended side effect of crippling another plugin's functionality or even crashing a controller. As of today, there is no better way to pre-test for such catastrophic conflicts than with a test controller. Test controllers should have identical configurations, jobs, and plugins as the production controller so that test upgrades will most closely resemble the outcomes of a similar change on your production controller. For example, installing the Folders plugin while running a version of the Jenkins core older than 1.554.1 will cause the controller crash and be inaccessible until the plugin is manually uninstalled from the \_plugin\_ folder. [#setting-up-a-test-controller] === Configuring a test controller There are many methods for setting up a test controller, but the commonality between them all is that the \_$JENKINS\_HOME\_ between them is nearly identical. Whether this means that most all of the \_$JENKINS\_HOME\_ folders are version controlled in a service like GitHub and mounted manually or programmatically to a test server or Docker container, the result is nearly the same. It is ideal to first ensure the controller is idle (no running or queued jobs) before attempting to create a test controller. \*With GitHub + manual commands\* You will simply need to open up your command-line interface and "cd" to the folder that contains the \_$JENKINS\_HOME\_ directory for your production controller and run the "git init" command. For the location of this folder, please refer to section 3. It is recommended that before running the "git add" command that you create a good \_.gitignore\_ file. This file will prevent you from accidentally version-controlling large binary files. Here is an example \_.gitignore\_ file for a Jenkins controller running on OS X: [source] ---- .DS\_Store .AppleDouble .LSOverride Icon .\_\* .Spotlight-V100 .Trashes .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk \*.log \*.tmp \*.old \*.jar \*.son .Xauthority .bash\_history .bash\_profile .fontconfig .gitconfig .gem .lesshst .mysql\_history .owner .ri .rvm .ssh .viminfo .vnc bin/ tools/ \*\*/.owner \*\*/queue.xml \*\*/fingerprints/ \*\*/shelvedProjects/ \*\*/updates/ \*\*/jobs/\*/workspace/ \*\*/war/ /tools/ \*\*/custom\_deps/ \*\*/cache/ \*\*/caches/ fingerprints/ \*.log \*.zip \*.rrd \*.gz ---- Once you have a good \_.gitignore\_ file, you can run the following git commands to commit your \_$JENKINS\_HOME\_ to a git repository like GitHub: [source,bash] ---- git add -—all git commit -m "first commit" git push ---- Now you can install Jenkins to a fresh deployment and "git clone" this \_$JENKINS\_HOME\_ from the git repository to your new controller. You will need to replace the files in the new controller with your version-controlled files to complete the migration, whether through scripts or through a drag-and-drop process. Once this is done, you will need to restart the new test Jenkins | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-manageability.adoc | main | jenkins | [
-0.016595738008618355,
-0.07655932754278183,
-0.00426818011328578,
0.03239418566226959,
0.049676381051540375,
-0.06588950753211975,
-0.1237935796380043,
-0.05967129394412041,
-0.011905727908015251,
0.02375970408320427,
0.006057301536202431,
0.003366707591339946,
-0.03724893555045128,
0.032... | 0.040017 |
this \_$JENKINS\_HOME\_ from the git repository to your new controller. You will need to replace the files in the new controller with your version-controlled files to complete the migration, whether through scripts or through a drag-and-drop process. Once this is done, you will need to restart the new test Jenkins service or reload its configuration from the Jenkins UI ("Manage Jenkins" >> "Reload Configuration"). \*With GitHub + Docker (Linux-only)\* When it comes to version controlling your $JENKINS\_HOME, just follow the instructions in the previous section. The next step will be to create a Docker image with identical configurations to your production deployment's - operating system (Linux-only), installed libraries/tools, and open ports. This can be accomplished through Dockerfiles. You will then just need to create mounted storage on your Docker server with a clone of your version-controlled \_$JENKINS\_HOME\_ home and a simple image to clone the \_$JENKINS\_HOME\_ into. For example, we can create a Docker image called \_jenkins-storage\_ and version control our \_$JENKINS\_HOME\_ in a Github repository known as "demo-joc". The "jenkins-storage" Docker image can be built from a Dockerfile similar to this: [source,bash] ---- FROM eclipse-temurin:21-jdk-jammy SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update && \ apt-get -y upgrade && \ apt-get install -y --no-install-recommends \ curl \ git \ git-lfs \ gpg \ less \ maven \ ntp \ ntpdate \ openssh-server \ vim && \ mkdir -p /etc/apt/keyrings && \ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] \ https://download.docker.com/linux/ubuntu jammy stable" \ >> /etc/apt/sources.list.d/docker.list 2> /dev/null && \ apt-get update && \ apt-get install -y --no-install-recommends \ containerd.io \ docker-ce \ docker-ce-cli \ docker-compose-plugin && \ apt-get clean && \ rm -rf /var/lib/apt/lists/\* RUN printf "AddressFamily inet" >> /etc/ssh/ssh\_config ENV MAVEN\_HOME /usr/bin/mvn ENV GIT\_HOME /usr/bin/git # Create Jenkins user RUN useradd jenkins -d /home/jenkins RUN echo "jenkins:jenkins" | chpasswd # Make directories for JENKINS\_HOME, jenkins.war lib # and [agents] remote FS root, ssh privilege separation directory RUN mkdir /usr/lib/jenkins /var/lib/jenkins /home/jenkins /var/run/sshd # Set permissions RUN chown -R jenkins:jenkins /usr/lib/jenkins /var/lib/jenkins /home/jenkins #create data folder for cloning RUN ["mkdir", "/data"] RUN ["chown", "-R", "jenkins:jenkins", "/data"] RUN usermod -a -G docker jenkins USER jenkins VOLUME ["/data"] WORKDIR /data # USER jenkins CMD ["git", "clone", "https://github.com/MarkEWaite/docker-jenkins-storage.git", "."] ---- Creating mounted storage for containers would just require something similar to the following command: [source,bash] ---- docker run \ --name storage \ [your-dockerhub-id]/jenkins-storage \ git clone https://github.com/[your-github-id]/docker-jenkins-storage.git . ---- And Jenkins images that rely on the mounted storage for their \_$JENKINS\_HOME\_ will then need to point to the mounted volume: [source,bash] ---- docker run -d \ --dns=172.17.42.1 \ --name joc-1 \ --volumes-from storage \ -e JENKINS\_HOME=/data/var/lib/jenkins/jenkins \ [your-dockerhub-id]/jenkins \ --prefix="" ---- [#test-master-agents] .Test agents Test controllers can be connected to test agents, but this will require further configurations. Depending on your implementation of a test controller, you will either need to create a Jenkins Docker agent image or an agent VM. Of course, open-source plugins like the EC2 plugin also the option of spinning up new agents on-demand. The agent connection information will also need to be edited in the config.xml located in your test \_$JENKINS\_HOME\_. .Rolling back plugins that cause failures If you discover that a plugin update is causing conflict within the test controller, you can rollback in several ways: \* For bad plugins, you can rollback the plugin from the UI by going to the plugin manager ("Manage Jenkins" >> "Plugins") and going to the "Available" tab. Jenkins will show a "downgrade" button next to any plugins that can be downgraded. \* If the UI is unavailable, then enter your \_$JENKINS\_HOME\_ | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-manageability.adoc | main | jenkins | [
-0.004605542402714491,
-0.05442536622285843,
-0.01069082785397768,
-0.016397984698414803,
0.06378994137048721,
-0.047806184738874435,
-0.06655694544315338,
-0.003655018052086234,
0.0007745484472252429,
0.04587595909833908,
0.013842826709151268,
-0.014594686217606068,
0.033318061381578445,
... | -0.053605 |
bad plugins, you can rollback the plugin from the UI by going to the plugin manager ("Manage Jenkins" >> "Plugins") and going to the "Available" tab. Jenkins will show a "downgrade" button next to any plugins that can be downgraded. \* If the UI is unavailable, then enter your \_$JENKINS\_HOME\_ folder and go to the plugins folder. From there, delete the .hpi or .jpi file for the offending plugin, then restart Jenkins. If you need to rollback to an older version, you will need to manually copy in an older version of that .jpi or .hpi. To do this, go to the plugin's page on the link:https://updates.jenkins.io/download/plugins[Jenkins updates site] and download one of its archived versions. == Troubleshooting for Stability A Jenkins controller can suffer instability problems when it is not properly sized for its hardware or when a buggy plugin wastes resources. To combat this, Jenkins administrators should begin their troubleshooting by identifying which components are behaving abnormally and which resources are insufficient. The administrator can link:https://wiki.jenkins.io/display/JENKINS/Obtaining+a+thread+dump[take thread dumps] and heap dumps to get some of this information, but in some cases where the controller has become non-operational and taking a thread dump is impossible, it is useful to have a persistent record outside of Jenkins itself to reference when such troubleshooting is required. === Using the Jenkins Metrics Plugin The {plugin}metrics[metrics plugin] is an open-source plugin that exposed Jenkins metrics. Metrics are exposed using the link:https://dropwizard.github.io/metrics/3.1.0[Dropwizard Metrics API] .Metrics exposed The exact list of exposed metrics varies depending on your installed plugins. To get a full list of available metrics for your controller, run the following script on the xref:managing:script-console.adoc[Jenkins script console]: [source,groovy] ---- for (j in Jenkins.instance.getExtensionList(jenkins.metrics.api.MetricProvider.class)) { for (m in j.getMetricSet()) { for (i in m.metrics) { println i.getKey() } } } ---- The {plugin}metrics[metrics plugin] documentation describes the available metrics. .Metrics Usage Metrics are protected by a set of permissions for viewing, accessing the thread dump, and posting a health check. The Metrics Operational Menu can be accessed via the web UI by visiting /metrics/currentUser, and the 4 menu options (Metrics, Ping, Threads, Healthcheck) lead to a JSON string containing the requested metrics or thread dump. Access to the Metrics Servlet can also be provided by issuing API keys. API keys can be configured from the Jenkins global configuration screen (/configure) under the "Metrics" section. Multiple access can be generated and permissions associated with those keys can also be restricted at this level. Additional information on hardware recommendations can be be found on the xref:hardware-recommendations.adoc[Hardware Recommendations] page | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/scaling/pages/architecting-for-manageability.adoc | main | jenkins | [
-0.06822279840707779,
-0.013063324615359306,
0.054583508521318436,
0.04251149296760559,
0.017917616292834282,
-0.04398877173662186,
-0.09734117239713669,
-0.057583682239055634,
-0.006479120347648859,
-0.04439157620072365,
-0.01342951413244009,
0.03226659074425697,
-0.043967362493276596,
0.... | 0.043953 |
= About Jenkins The \*Manage Jenkins >> About Jenkins\* page shows the current release of Jenkins on your system plus information about licenses for all components. The top of the display shows the release and version of Jenkins that is running. The following information about your Jenkins cluster is also provided: \* List of all third-party libraries used for this release of Jenkins, with links to licensing details about each library. \* List of static resources that are installed. \* List of installed plugins, each of which includes a link to the page that shows all third-party dependencies for each plugin with a link to licensing details about each library. This video shares different methods to check the version of Jenkins being used. .What is the latest version of Jenkins? video::--uAoNOZtKo[youtube,width=800,height=420] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/about-jenkins.adoc | main | jenkins | [
0.01289899181574583,
-0.035165973007678986,
0.004472235683351755,
-0.02799709141254425,
0.054400332272052765,
-0.0061047375202178955,
-0.04714503884315491,
-0.0852247029542923,
0.027340320870280266,
-0.003562507452443242,
-0.032402876764535904,
0.009497467428445816,
-0.06880165636539459,
-... | 0.116241 |
= System Information The \*Manage Jenkins >> System Information\* page provides detailed information about what is available on this Jenkins instance: \* \*System Properties\* that can be used as arguments to the command line used to start Jenkins. \* \*Environment Variables\* recognized on this system, with current values. This includes the environment variables defined by Jenkins and available on all systems as well as environment variables associated with plugins installed on this instance. \* List of Plugins installed on the system. \* \*Memory Usage\* gives a graph that shows the current memory usage for this instance. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-info.adoc | main | jenkins | [
0.0376417450606823,
0.0121780289337039,
-0.07171355932950974,
0.03043363243341446,
0.016258766874670982,
-0.043751705437898636,
0.030349919572472572,
0.024649061262607574,
0.03166331350803375,
-0.014746599830687046,
-0.05163803696632385,
-0.018477490171790123,
-0.0009739703382365406,
-0.05... | 0.193993 |
= Groovy Hook Scripts :page-layout: wip In several places inside Jenkins, a series of "hook scripts" get executed to allow some actions to take place in reaction to some key events. These scripts are written in Groovy, and get executed inside the same JVM as Jenkins, allowing full access to the domain model of Jenkins. For given hook \_HOOK\_, the following locations are searched: \* `+WEB-INF/HOOK.groovy+` in `+jenkins.war+` \* `+WEB-INF/HOOK.groovy.d/\*.groovy+` in the lexical order in `+jenkins.war+` \* `+$JENKINS\_HOME/HOOK.groovy+` \* `+$JENKINS\_HOME/HOOK.groovy.d/\*.groovy+` in the lexical order `+HOOK.groovy.d+` is suitable to avoid conflicts — multiple entities can insert stuff into the hook without worrying about overwriting each other's code. The following events use this mechanism by replacing `+HOOK+` in `+HOOK.groovy.d+` or `+HOOK.groovy+` by one of the below mentioned types: \* \*init\*: Post-initialization script \* \*boot-failure\*: Boot failure hook == Post initialization script (init hook) You can create a Groovy script file `+$JENKINS\_HOME/init.groovy+`, or any `+.groovy+` file in the directory `+$JENKINS\_HOME/init.groovy.d/+`, to run some additional things right after Jenkins starts up. The groovy scripts are executed at the end of Jenkins initialization. This script can access classes in Jenkins and all the plugins. So for example, you can write something like: [source, groovy] .... import jenkins.model.Jenkins; // start in the state that doesn't do any build. Jenkins.instance.doQuietDown(); .... Output is logged to the Jenkins log file. For Debian based users, this is /var/log/jenkins/jenkins.log NOTE: If you are using the Jenkins Docker image, `$JENKINS\_HOME/init.groovy.d/` does not exist. Instead, you should place the Groovy script files in `/usr/share/jenkins/ref/init.groovy.d/`, as this directory is copied when the Docker container starts. For more details, refer to the link:https://github.com/jenkinsci/docker?tab=readme-ov-file#installing-more-tools[Installing more tools documentation]. == Boot failure hook When Jenkins encounters a fatal problem during boot, it'll invoke "boot-failure" hook script to allow automatic corrective actions to be taken (such as notifying somebody, raising alerts, restarting, and so on.) These scripts get the cause of the problem as the "exception" variable when run. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/groovy-hook-scripts.adoc | main | jenkins | [
-0.0347859188914299,
-0.012764899991452694,
0.014532359316945076,
-0.03730015829205513,
0.015900226309895515,
-0.04637082666158676,
-0.0011195404222235084,
-0.06789711862802505,
0.05310114473104477,
-0.0020959426183253527,
0.013108422048389912,
0.02883601002395153,
0.014552327804267406,
-0... | 0.075222 |
= Script Console Jenkins features a Groovy script console which allows one to run arbitrary Groovy scripts within the Jenkins controller runtime or in the runtime on agents. [IMPORTANT] ==== It is \_very\_ \*important\* to understand all of the following points because it affects the integrity of your Jenkins installation. The Jenkins Script Console: \* Access is controlled by the `+Administer+` permission. \* Is a web-based Groovy shell into the Jenkins runtime. Groovy is a very powerful language which offers the ability to do practically anything Java can do including: \*\* Create sub-processes and execute arbitrary commands on the Jenkins controller and agents. \*\* It can even read files in which the Jenkins controller has access to on the host (like `/etc/passwd`) \*\* Decrypt credentials configured within Jenkins. \* Offers no administrative controls to stop a User (or Admin) once they are able to execute the Script Console from affecting all parts of the Jenkins infrastructure. Granting a normal Jenkins user Script Console Access is essentially the same as giving them Administrator rights within Jenkins. \* Can configure any Jenkins setting. It can disable security, reconfigure security, even open a backdoor on the host operating system completely outside of the Jenkins process. Due to the mission critical importance many organizations place on Jenkins in their infrastructure this point is especially important because it would allow an attacker to move laterally within infrastructure with little effort. \* Is so powerful because it was originally intended as a debugging interface for Jenkins developers but has since grown into an interface used by Jenkins Admins to configure Jenkins and debug Jenkins runtime issues. Additional security considerations for administrative scripts: \* Scripts can bypass all security controls and access any data. \* Credentials accessed via scripts are decrypted. \* Changes made via scripts may not be audited in the normal logs. \* Scripts can modify Jenkins at the lowest levels, potentially making it unstable. Because of the power offered by the Jenkins Script Console, Jenkins and its agents should never be run as the `root` user (on Linux) or system administrator on any other flavor of OS. Videos linked in this page demonstrate and discuss security warnings. \*Be sure to secure your Jenkins instance\* ==== toc::[] == Multiple contexts The Jenkins Script Console can run either on the controller or any configured agents. === Running Script Console on the controller This feature can be accessed from \_"Manage Jenkins" > "Script Console"\_. Or by visiting the sub-URL `/script` on your Jenkins controller. === Running Script Console on agents Visit \_"Manage Jenkins" > "Manage Nodes"\_. Select any node to view the status page. In the menu on the left, a menu item is available to open a "Script Console" on that specific agent. === Run scripts from controller Script Console on agents It's also possible to run scripts from the controller Script Console on individual agents. The following script is an example running a script on agents from the controller Script Console. \*Script executes code on agent from Master Script Console\* [source,groovy] ---- import hudson.util.RemotingDiagnostics import jenkins.model.Jenkins String agentName = 'your agent name' //groovy script you want executed on an agent groovy\_script = ''' println System.getenv("PATH") println "uname -a".execute().text '''.trim() String result Jenkins.instance.slaves.find { agent -> agent.name == agentName }.with { agent -> result = RemotingDiagnostics.executeGroovy(groovy\_script, agent.channel) } println result ---- === Reading and writing files Files can be read and written directly on the controller or agents via the controller Script Console. \*Write a file to the Jenkins controller\* [source,groovy] ---- new File('/tmp/file.txt').withWriter('UTF-8') { writer -> try { writer << 'hello world\n' } finally { | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/script-console.adoc | main | jenkins | [
-0.03085152618587017,
0.023166734725236893,
-0.04546946659684181,
-0.02051319181919098,
0.00008591158257331699,
-0.06582732498645782,
0.027064215391874313,
0.014669573865830898,
0.008269540034234524,
0.001491346163675189,
-0.06550951302051544,
-0.0044138431549072266,
0.017271649092435837,
... | 0.146337 |
agent.channel) } println result ---- === Reading and writing files Files can be read and written directly on the controller or agents via the controller Script Console. \*Write a file to the Jenkins controller\* [source,groovy] ---- new File('/tmp/file.txt').withWriter('UTF-8') { writer -> try { writer << 'hello world\n' } finally { writer.close() } } ---- \*Reading a file from the Jenkins controller\* [source,groovy] ---- new File('/tmp/file.txt').text ---- \*Write file to agent through agent channel\* [source,groovy] ---- import hudson.FilePath import hudson.remoting.Channel import jenkins.model.Jenkins String agentName = 'some-agent' String filePath = '/tmp/file.txt' Channel agentChannel = Jenkins.instance.slaves.find { agent -> agent.name == agentName }.channel new FilePath(agentChannel, filePath).write().with { os -> try { os << 'hello world\n' } finally { os.close() } } ---- \*Read file from agent through agent channel\* [source,groovy] ---- import hudson.FilePath import hudson.remoting.Channel import jenkins.model.Jenkins import java.io.BufferedReader import java.io.InputStreamReader import java.nio.charset.StandardCharsets import java.util.stream.Collectors String agentName = 'some-agent' String filePath = '/tmp/file.txt' Channel agentChannel = Jenkins.instance.slaves.find { agent -> agent.name == agentName }.channel String fileContents = '' new FilePath(agentChannel, filePath).read().with { is -> try { fileContents = new BufferedReader( new InputStreamReader(is, StandardCharsets.UTF\_8)) .lines() .collect(Collectors.joining("\n")) } finally { is.close() } } // print contents of the file from the agent println '===' println(fileContents) println '===' ---- == Administrative capabilities The Script Console provides powerful administrative functions for managing Jenkins. Below are common administrative tasks with examples: === User management [source,groovy] ---- Jenkins.instance.securityRealm.allUsers.each { user -> println user.id + ": " + user.fullName } import hudson.model.User import jenkins.model.Jenkins User user = User.get('new-user', true) user.fullName = "New User" user.save() ---- === System configuration [source,groovy] ---- Jenkins.instance.systemMessage = "New system message" Jenkins.instance.save() println Jenkins.VERSION ---- === Plugin management [source,groovy] ---- Jenkins.instance.pluginManager.plugins.each { println "${it.shortName}: ${it.version}" } Jenkins.instance.pluginManager.getPlugin('git').disable() ---- === Node/Agent management [source,groovy] ---- Jenkins.instance.nodes.each { node -> println "${node.name}: ${node.numExecutors} executors" } Jenkins.instance.getNode('agent-name').computer.doDoDelete() ---- == Best practices for system groovy When using the Script Console for administrative tasks: \* Always test scripts in a non-production environment first \* xref:system-administration:backing-up.adoc[Backup your Jenkins configuration] before running scripts \* Use the xref:developer:security:misc.adoc[Jenkins API] rather than direct filesystem manipulation when possible \* Limit script scope so that only necessary operations are performed \* Add comments to scripts for future reference \* Consider using plugins like {plugin}job-dsl[Job DSL] or {plugin}configuration-as-code[Configuration as Code] for repeatable configurations \* Review scripts carefully to ensure they execute with full system privileges \* Monitor script execution as long-running scripts may impact performance === Example: safe script template [source,groovy] ---- try { Jenkins.instance.doSomething() Jenkins.instance.save() println "Operation completed successfully" } catch(Exception e) { println "Error: ${e.message}" } ---- == Remote access A Jenkins Admin can execute groovy scripts remotely by sending an HTTP POST request to `/script/` url or `/scriptText/`. \*curl example via bash\* [source,shell] ---- curl -d "script=" https://jenkins/script # or to get output as a plain text result (no HTML) curl -d "script=" https://jenkins/scriptText ---- Also, xref:managing:cli.adoc[Jenkins CLI] offers the possibility to execute groovy scripts remotely using `groovy` command or execute groovy interactively via `groovysh`. However, once again curl can be used to execute groovy scripts by making use of bash command substitution. In the following example `somescript.groovy` is a groovy script in the current working directory. \*Curl submitting groovy file via bash\* [source,shell] ---- curl --data-urlencode "script=$(< ./somescript.groovy)" https://jenkins/scriptText ---- If security is configured in Jenkins, then curl can be provided options to authenticate using the `curl --user` option. \*Curl submitting groovy file providing username and api token via bash\* [source,shell] ---- curl --user 'username:api-token' --data-urlencode \ "script=$(< ./somescript.groovy)" https://jenkins/scriptText ---- Here is the equivalent command using python, not curl. \*Python submitting groovy file providing username and api token\* [source,python] ---- with open('somescript.groovy', 'r') as | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/script-console.adoc | main | jenkins | [
0.01644413359463215,
0.020726187154650688,
-0.08456262946128845,
-0.01896507851779461,
-0.040659017860889435,
-0.047282811254262924,
0.008095437660813332,
0.01794721744954586,
0.00887722335755825,
-0.01475416962057352,
-0.029329687356948853,
0.014130785129964352,
-0.029514558613300323,
-0.... | 0.033345 |
the `curl --user` option. \*Curl submitting groovy file providing username and api token via bash\* [source,shell] ---- curl --user 'username:api-token' --data-urlencode \ "script=$(< ./somescript.groovy)" https://jenkins/scriptText ---- Here is the equivalent command using python, not curl. \*Python submitting groovy file providing username and api token\* [source,python] ---- with open('somescript.groovy', 'r') as fd: data = fd.read() r = requests.post('https://jenkins/scriptText', auth=('username', 'api-token'), data={'script': data}) ---- == Shortcut key on script console to submit You can submit a script without mouse. Jenkins has a shortcut key which enables to submit with keyboard. \* Windows / Linux: Ctrl + Enter \* Mac: Command + Enter == Video Tutorials and additional learning materials Here are some recorded videos on the Jenkins Script Console: \* https://www.youtube.com/watch?v=qaUPESDcsGg[Jenkins World 2017: Mastering the Jenkins Script Console] - 44 minutes - sample usage and security discussion \* https://www.youtube.com/watch?v=T1x2kCGRY1w[LA Jenkins Area Meetup 2016 - Hacking on Jenkins Internals - Jenkins Script Console] - 39 minutes - sample usage To expand your ability to write scripts in the script console, the following references are recommended: \* http://groovy-lang.org/learn.html[Learn Groovy] - Learning Groovy is useful for more than writing scripts for the Script Console. Groovy is also relevant for other features of Jenkins like xref:pipeline:index.adoc[Pipelines and shared pipeline libraries], the https://plugins.jenkins.io/groovy[Groovy Plugin], the https://plugins.jenkins.io/job-dsl[Job DSL plugin], and many other plugins which utilize Groovy (see section xref:#plugins-enabling-groovy-usage[Plugins-enabling-Groovy-usage]). \* http://www.mdoninger.de/2011/11/07/write-groovy-scripts-for-jenkins-with-code-completion.html[Write Groovy scripts for Jenkins with Code completion] - The gist of this is to create a Maven project within your IDE and to depend on org.jenkins-ci.main:jenkins-core (and any other plugins that you expect present). You can then write a Groovy script with code completion of Jenkins API objects and methods. == Example Groovy scripts === Out of date scripts Due to the nature of Groovy scripts accessing Jenkins source code directly, Script Console scripts are easily out of date from the Jenkins source code. It is possible to run a script and get exceptions because public methods and interfaces in Jenkins core or Jenkins plugins have changed. Keep this in mind when trying out examples. Jenkins is easily started from a local development machine via the following command: \*Starting a local copy of Jenkins\* [source,shell] ---- export JENKINS\_HOME="./my\_jenkins\_home" java -jar jenkins.war ---- Use CTRL+C to stop Jenkins. It is not recommended to try Script Console examples in a production Jenkins controller. The following repositories offer solid examples of Groovy scripts for Jenkins. \* https://github.com/cloudbees/jenkins-scripts[CloudBees jenkins-scripts repository]. \* link:https://github.com/jenkinsci/jenkins-scripts[Jenkins CI jenkins-scripts repository under the `scriptler/` directory] (scripts for the link:https://plugins.jenkins.io/scriptler[Scriptler Plugin]). \* https://github.com/samrocketman/jenkins-script-console-scripts[Sam Gleske's jenkins-script-console-scripts repository]. \* https://github.com/samrocketman/jenkins-bootstrap-shared[Sam Gleske's jenkins-bootstrap-shared repository under the `+scripts/+` directory]. Browse all https://plugins.jenkins.io/scriptler[Scriptler Plugin] Groovy Scripts and \*please share your scripts with the\* \*https://plugins.jenkins.io/scriptler[Scriptler Plugin].\* \* https://wiki.jenkins.io/display/JENKINS/Activate+Chuck+Norris+Plugin[Activate Chuck Norris Plugin] — This script activates Chuck Norris plugin for all jobs in your Jenkins server \* https://wiki.jenkins.io/JENKINS/74416647.html[Add a Maven Installation, Tool Installation, Modify System Config] \* https://wiki.jenkins.io/display/JENKINS/Add-a-new-label-to-agents-meeting-a-condition.html[Add a new label to agents meeting a condition] — This script shows how to alter the agent nodes' label membership. In this case we create a new label if the existing label contains a string. It has been tested from the Jenkins command window. \* https://wiki.jenkins.io/display/JENKINS/Add+notification+plugin+to+every+job[Add notification plugin to every job] — This script will add the Notification Plugin to every job. \* https://wiki.jenkins.io/display/JENKINS/Allow+broken+build+claiming+on+every+jobs[Allow broken build claiming on every jobs] — With the following simple script, you can activate the option on every jobs of your server in just one go. \* https://wiki.jenkins.io/display/JENKINS/Batch-Update+Mercurial+branch+that+is+checked+out[Batch-Update Mercurial branch that is checked out] — Updates for multiple jobs which branch will be checked out from Hg \* https://wiki.jenkins.io/display/JENKINS/Bulk+rename+projects[Bulk rename projects] \* https://wiki.jenkins.io/display/JENKINS/Change+JVM+Options+in+all+Maven+tasks+of+Freestyle+Jobs[Change JVM Options in all Maven tasks of Freestyle Jobs] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/script-console.adoc | main | jenkins | [
-0.046293407678604126,
0.008580442517995834,
-0.0305628664791584,
-0.013801555149257183,
-0.03946443274617195,
-0.07156810164451599,
-0.024772044271230698,
0.02751561813056469,
0.0050207399763166904,
0.006950913462787867,
-0.060440078377723694,
-0.04840274527668953,
0.05132973939180374,
-0... | 0.01803 |
can activate the option on every jobs of your server in just one go. \* https://wiki.jenkins.io/display/JENKINS/Batch-Update+Mercurial+branch+that+is+checked+out[Batch-Update Mercurial branch that is checked out] — Updates for multiple jobs which branch will be checked out from Hg \* https://wiki.jenkins.io/display/JENKINS/Bulk+rename+projects[Bulk rename projects] \* https://wiki.jenkins.io/display/JENKINS/Change+JVM+Options+in+all+Maven+tasks+of+Freestyle+Jobs[Change JVM Options in all Maven tasks of Freestyle Jobs] — This script find all Maven Tasks registered in freestyle jobs and replace JVM Options by a new value. \* https://wiki.jenkins.io/display/JENKINS/Change+publish+over+SSH+configuration[Change publish over SSH configuration] \* https://wiki.jenkins.io/display/JENKINS/Change+SCMTrigger+for+each+project+to+disable+during+the+night+and+the+week-end[Change SCMTrigger for each project to disable during the night and the week-end] — This script lets you easily change all jobs running every minutes so that it gets disabled between 21:00 and 07:00 and on Saturday and Sunday. \* https://wiki.jenkins.io/display/JENKINS/Change+Version-Number+in+SVN-path[Change Version-Number in SVN-path] \* https://wiki.jenkins.io/display/JENKINS/Clone+all+projects+in+a+View[Clone all projects in a View] — This script enumerates all projects belonging to a specific view and clones them. \* https://wiki.jenkins.io/display/JENKINS/Convert+standard+mail+notifications+to+use+the+Mail-Ext+Publisher+plugin[Convert standard mail notifications to use the Mail-Ext Publisher plugin] — This script replace mail notifications in all projects by Mail-Ext publisher plugin and re-uses existing recipients. \* https://wiki.jenkins.io/display/JENKINS/Delete+.tmp+files+left+in+workspace-files[Delete tmp files left in workspace-files] — This scripts deletes all the tmp files left in workspace-files directory after the build. On windows servers this seems pretty common. \* https://wiki.jenkins.io/display/JENKINS/Delete+workspace+for+all+disabled+jobs[Delete workspace for all disabled jobs] — Deletes the workspace for all disabled jobs to save space \* https://wiki.jenkins.io/display/JENKINS/Disable+all+jobs[Disable all jobs] — This script disables all jobs in your Jenkins server \* https://wiki.jenkins.io/display/JENKINS/Display+Information+About+Nodes[Display Information About Nodes] — This scripts displays a bunch of information about all the agent nodes. \* https://wiki.jenkins.io/display/JENKINS/Display+job+parameters[Display job parameters] — This scripts displays the parameters for all the jobs along with their default values (if applicable). \* https://wiki.jenkins.io/display/JENKINS/Display+jobs+group+by+the+build+steps+they+use[Display jobs group by the build steps they use] \* https://wiki.jenkins.io/display/JENKINS/Display-list-of-projects-that-were-built-more-than-1-day-ago..html[Display list of projects that were built more than 1 day ago.] — This script to display list of projects that were built more than 1 day ago. \* https://wiki.jenkins.io/display/JENKINS/Display+mail+notifications+recipients[Display mail notifications recipients] — This script displays for all jobs the list of mail recipients used for notifications. \* https://wiki.jenkins.io/display/JENKINS/Display+monitors+status[Display monitors status] — Jenkins uses monitors to validate various behaviors. If you dismiss one, Jenkins will never propose you to reactivate it. This script allows you to check the status of all monitors and to reactivate them. \* https://wiki.jenkins.io/display/JENKINS/138454178.html[Display the number of jobs using SCM Polling from Freestyle, Pipeline and Maven] \* https://wiki.jenkins.io/display/JENKINS/Display+timer+triggers[Display timer triggers] — This scripts displays the timer triggers for all the jobs in order to better arrange them. \* https://wiki.jenkins.io/display/JENKINS/Display+Tools+Location+on+All+Nodes[Display Tools Location on All Nodes] — This script can help to get Jenkins tools location on all your agents \* https://wiki.jenkins.io/display/JENKINS/Enable+Timestamper+plugin+on+all+jobs[Enable Timestamper plugin on all jobs] — With the following simple script, you can activate the option on every jobs of your server in just one go. \* https://wiki.jenkins.io/display/JENKINS/Failed+Jobs[Failed Jobs] — This scripts displays a list of all failed jobs. Addon: restart them. \* https://wiki.jenkins.io/display/JENKINS/Find+builds+currently+running+that+has+been+executing+for+more+than+N+seconds[Find builds currently running that has been executing for more than N seconds] \* https://wiki.jenkins.io/display/JENKINS/Grant+Cancel+Permission+for+user+and+group+that+have+Build+permission[Grant Cancel Permission for user and group that have Build permission] — This script will go through all groups and users in both Global security and per job security settings. \* https://wiki.jenkins.io/display/JENKINS/Invalidate+Jenkins+HTTP+sessions[Invalidate Jenkins HTTP sessions] — This script can monitor and invalidate HTTP sessions if there are many open ones on your server. \* https://wiki.jenkins.io/display/JENKINS/Manually+run+log+rotation+on+all+jobs[Manually run log rotation on all jobs] — Runs log rotation on all jobs to free space \* https://wiki.jenkins.io/display/JENKINS/Monitor+and+Restart+Offline+Slaves[Monitor and Restart Offline Agents] — This script can monitor and restart offline nodes if they are not disconnected manually. \* https://wiki.jenkins.io/display/JENKINS/Monitoring+Scripts[Monitoring Scripts] — Several scripts to display data about http sessions, threads, memory, JVM or MBeans, when using the Monitoring plugin. \* https://wiki.jenkins.io/display/JENKINS/My+Test+Grovvy[My Test Grovvy] | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/script-console.adoc | main | jenkins | [
-0.015209722332656384,
-0.00918116420507431,
-0.04475243762135506,
0.026116598397493362,
0.05970536917448044,
-0.024273324757814407,
-0.02617480605840683,
-0.05227827653288841,
-0.016025392338633537,
-0.02289416454732418,
0.016234034672379494,
-0.028285115957260132,
-0.001671439385972917,
... | 0.069979 |
to free space \* https://wiki.jenkins.io/display/JENKINS/Monitor+and+Restart+Offline+Slaves[Monitor and Restart Offline Agents] — This script can monitor and restart offline nodes if they are not disconnected manually. \* https://wiki.jenkins.io/display/JENKINS/Monitoring+Scripts[Monitoring Scripts] — Several scripts to display data about http sessions, threads, memory, JVM or MBeans, when using the Monitoring plugin. \* https://wiki.jenkins.io/display/JENKINS/My+Test+Grovvy[My Test Grovvy] \* https://wiki.jenkins.io/display/JENKINS/Parameterized+System+Groovy+script[Parameterized System Groovy script] — This script will demonstrate how to get parameters in a system groovy script. \* https://wiki.jenkins.io/display/JENKINS/Preselect+username+in+Maven+Release+Build[Preselect username in Maven Release Build] \* https://wiki.jenkins.io/display/JENKINS/Printing+a+list+of+credentials+and+their+IDs[Printing a list of credentials and their IDs] \* https://wiki.jenkins.io/display/JENKINS/Remove+all+disabled+modules+in+Maven+jobs[Remove all disabled modules in Maven jobs] — To remove all disabled modules in Maven jobs \* https://wiki.jenkins.io/display/JENKINS/Remove+Deployed+Artifacts+Actions[Remove Deployed Artifacts Actions] — This script is used to remove the Deployed Artifacts list that is uselessly stored for each build by the Artifact Deployer Plugin. \* https://wiki.jenkins.io/display/JENKINS/Remove+Git+Plugin+BuildsByBranch+BuildData[Remove Git Plugin BuildsByBranch BuildData] — This script is used to remove the static list of BuildsByBranch that is uselessly stored for each build by the Git Plugin. \* https://wiki.jenkins.io/display/JENKINS/Set+GitBlitRepositoryBrowser+with+custum+settings+on+all+repos[Set GitBlitRepositoryBrowser with custom settings on all repos] — This scripts allows to update the repo browser. Can be adapted to any other browser, not only gitblit. \* https://wiki.jenkins.io/display/JENKINS/Update+maven+jobs+to+use+the+post+build+task+to+deploy+artifacts[Update maven jobs to use the post build task to deploy artifacts] — This script updates all maven jobs having a deploy goal by install and activate the post build step to deploy artifacts at the end of the build \* https://wiki.jenkins.io/display/JENKINS/Update+SVN+Browser[Update SVN Browser] \* https://wiki.jenkins.io/display/JENKINS/Wipe+out+workspaces+of+all+jobs[Wipe out workspaces of all jobs] — This script wipes out the workspaces of all jobs on your Jenkins server \* https://wiki.jenkins.io/display/JENKINS/Wipe+workspaces+for+a+set+of+jobs+on+all+nodes[Wipe workspaces for a set of jobs on all nodes] — The script wipes workspaces of certain jobs on all nodes. [#plugins-enabling-groovy-usage] == Plugins enabling Groovy usage - link:https://plugins.jenkins.io/config-file-provider[Config File Provider Plugin] Adds the ability to provide configuration files (i.e., settings.xml for maven, XML, groovy, custom files, etc.) loaded through the Jenkins UI which will be copied to the job's workspace. - link:https://plugins.jenkins.io/global-post-script[Global Post Script Plugin] — Execute a global configured groovy script after each build of each job managed by the Jenkins. This is typical for cases when you need to do something based on a shared set of parameters, such as triggering downstream jobs managed by the same Jenkins or remote ones based on the parameters been passed to the parameterized jobs. - https://plugins.jenkins.io/groovy[Groovy plugin] - https://plugins.jenkins.io/groovy-postbuild[Groovy Postbuild Plugin] — This plugin executes a groovy script in the Jenkins JVM. Typically, the script checks some conditions and changes accordingly the build result, puts badges next to the build in the build history and/or displays information on the build summary page. - https://plugins.jenkins.io/groovy-remote[Groovy Remote Control Plugin] — This plugin provides http://groovy.codehaus.org/modules/remote/[Groovy Remote Control]'s receiver, and allows to control external application from Jenkins. - https://plugins.jenkins.io/matrix-groovy-execution-strategy[Matrix Groovy Execution Strategy Plugin] — A plugin to decide the execution order and valid combinations of matrix projects. - https://plugins.jenkins.io/scriptler[Scriptler Plugin] — Scriptler allows you to store/edit groovy scripts and execute it on any of the nodes... no need to copy/paste groovy code anymore. | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/script-console.adoc | main | jenkins | [
-0.04870108142495155,
-0.0010977378115057945,
-0.15252041816711426,
0.017049217596650124,
0.004198565613478422,
-0.06485238671302795,
0.025059951469302177,
0.028704531490802765,
-0.016880348324775696,
-0.007930416613817215,
-0.04401149973273277,
0.01635735109448433,
0.04927678033709526,
-0... | 0.104846 |
= Spawning Processes From Build It is possible to spawn a process from a build and have that process live longer than the build itself. For example, perhaps the build launches a new application server with the result of the build. In older releases, the build often did not terminate. Instead, the specific step (such as the shell script, Ant, or Maven) terminates but the build itself does not terminate. Jenkins detects this situation and, instead of blocking indefinitely, prints out a warning and terminates the build. == Why? This happens because of how file descriptors are used between processes in a build. Jenkins and the child process are connected by three pipes (`stdin`, `stdout`, and `stderr`.) This allows Jenkins to capture the output from the child process. The child process may write a lot of data to the pipe and quit immediately after that, so Jenkins waits for end-of-file (EOF) to be sure that it has drained the pipes before it terminates the build. Whenever a process terminates, the operating system closes all the file descriptors it owned. So, even if the process did not close `stdout` and `stderr`, Jenkins gets end of file (EOF). The complication happens when those file descriptors are inherited by other processes. Let's say the child process forks another process to the background. The background process (which is actually a daemon) inherits all the file descriptors of the parent, including the writing side of the `stdout` ad `stderr` pipes that connect the child process and Jenkins. If the daemon forgets to close them, Jenkins does not get EOF for pipes even when the child process exits, because the daemon still has those descriptors open. This is how this problem happens. A daemon should close all file descriptors to avoid such issues but some daemons do not follow the rule. You can mitigate this problem with various workarounds. == Workarounds On Unix, you can use a wrapper like http://www.clapper.org/software/daemonize/[this] to make the daemon behave. For example: [source,daemon] ---- daemonize -E BUILD\_ID=dontKillMe /path/to/your/command ---- In a Jenkins Pipeline, use `+JENKINS\_NODE\_COOKIE+` instead of `+BUILD\_ID+`. Note that this will set the BUILD\_ID environment variable for the process being spawned to something other than the current BUILD\_ID. Or you can start jenkins with `-Dhudson.util.ProcessTree.disable=true`. On Windows, use the http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true['at' command] to launch a process in the background. For example: [source] ---- date = new java.text.SimpleDateFormat("HH:mm") .format(new Date(System.currentTimeMillis() + 60000)); project.setProperty(attributes.get("property"), date); ---- Another similar workaround on Windows is to use a wrapper script and launch your program through it: [source] ---- // antRunAsync.js - Wrapper script to run an executable detached in the // background from Ant's task. This works by running the executable // using the Windows Scripting Host WshShell.Run method which doesn't copy // the standard filehandles stdin, stdout and stderr. Ant finds them closed // and doesn't wait for the program to exit. // // requirements: // Windows Scripting Host 1.0 or better. This is included with Windows // 98/Me/2000/XP. Users of Windows 95 or Windows NT 4.0 need to download // and install WSH support from // http://msdn.microsoft.com/scripting/. // // usage: // // // // // // // var WshShell = WScript.CreateObject("WScript.Shell"); var exeStr = "%comspec% /c"; var arg = ""; var windowStyle = 1; var WshProcessEnv = WshShell.Environment("PROCESS"); var windowTitle = WshProcessEnv("ANTRUN\_TITLE"); var outputFile = WshProcessEnv("ANTRUN\_OUTPUT"); var OS = WshProcessEnv("OS"); var isWindowsNT = (OS == "Windows\_NT"); // On Windows NT/2000/XP, specify a title for the window. If the environment // variable ANTRUN\_TITLE is specified, that will be used instead of a default. if (isWindowsNT) { if (windowTitle == "") windowTitle = "Ant - " | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/spawning-processes.adoc | main | jenkins | [
-0.04093746095895767,
0.03733072057366371,
0.04298252984881401,
0.01736273430287838,
0.08277477324008942,
-0.09547679871320724,
-0.0765061303973198,
-0.03830605372786522,
0.09537886828184128,
0.04536675661802292,
-0.04467939957976341,
-0.008497429080307484,
-0.0006195744499564171,
-0.04787... | 0.084979 |
= WshProcessEnv("ANTRUN\_OUTPUT"); var OS = WshProcessEnv("OS"); var isWindowsNT = (OS == "Windows\_NT"); // On Windows NT/2000/XP, specify a title for the window. If the environment // variable ANTRUN\_TITLE is specified, that will be used instead of a default. if (isWindowsNT) { if (windowTitle == "") windowTitle = "Ant - " + WScript.Arguments(i); exeStr += "title " + windowTitle + " &&"; } // Loop through arguments quoting ones with spaces for (var i = 0; i < WScript.Arguments.count(); i++) { arg = WScript.Arguments(i); if (arg.indexOf(' ') > 0) exeStr += " \"" + arg + "\""; else exeStr += " " + arg; } // If the environment variable ANTRUN\_OUTPUT was specified, redirect // output to that file. if (outputFile != "") { windowStyle = 7; // new window is minimized exeStr += " > \"" + outputFile + "\""; if (isWindowsNT) exeStr += " 2>&1"; } // WScript.Echo(exeStr); // WshShell.Run(exeStr); WshShell.Run(exeStr, windowStyle, false); ---- This self-provided wrapper script can be called from Ant for example: [source] ---- ---- Another workaround for Windows is to schedule a permanent task and force running it from the Ant script. For example, run the command: [source] ---- C:\>SCHTASKS /Create /RU SYSTEM /SC ONSTART /TN Tomcat /TR "C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\startup.bat" ---- Note, that `ONSTART` can be replaced with `ONCE` if you do not want to keep Tomcat running. Add the following code to your Ant script: [source] ---- ---- | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/spawning-processes.adoc | main | jenkins | [
0.04044115170836449,
0.01238383911550045,
0.0095592699944973,
0.028333630412817,
-0.022321177646517754,
0.006521639414131641,
0.07251960784196854,
0.07053188979625702,
-0.012157782912254333,
0.01252723578363657,
-0.09936181455850601,
-0.05023425072431564,
-0.0033254746813327074,
-0.0364477... | 0.07734 |
= Jenkins Features Controlled with System Properties ++++ .doc h5{ color: deeppink } ++++ //// properties: Style guide: - Prefer literal blocks over quoted blocks when necessary - Format literal default values in `backticks` and descriptive parts of values outside backticks - Use sentence-per-line formatting for descriptions Tags: - development: Mostly or only useful during development and debugging. While in rare cases these may help troubleshoot an instance, primary use is development. - escape hatch: Disables a behavior that is not generally expected to be disabled, such as security fixes. Intended to address unexpected compatibility problems. - feature: Enables (or rarely disables) a feature. Distinction to escape hatches is fuzzy when it disables. - internal: Not intended to be set by administrators, developers, or packaging scripts at all. Very rare. - obsolete: This option no longer has an effect or a different option should be used instead. - packaging: Options generally only useful when customizing the Jenkins packaging. - security: Related to security, both security fixes, and hardening. Usually also escape hatches. - tuning: Adjust thresholds, durations, and values of a similar nature that don't substantially alter behavior. - ui: User interface related. //// Jenkins has several "hidden" features that can be enabled with system properties. This page documents many of them and explain how to configure them on your instance. Some system properties related to the Remoting library used for communication between controller and agents are documented in link:https://github.com/jenkinsci/remoting/blob/master/docs/configuration.md[that component’s repository]. == Usage System properties are defined by passing `-Dproperty=value` to the `java` command line to start Jenkins. Make sure to pass all of these arguments before the `-jar` argument, otherwise they will be ignored. Example: .bash [source] ---- java -Dhudson.footerURL=http://example.org -jar jenkins.war ---- The following lists the properties and the version of Jenkins they were introduced in. `Property` - Java property name \*Default\* - Default value if not explicitly set \*Since\* - The version of Jenkins the property was introduced in \*Description\* - Other notes == Compatibility We do \*NOT\* guarantee that system properties will remain unchanged and functional indefinitely. These switches are often experimental in nature, and subject to change without notice. If you find these useful, please file a ticket to promote it to an official feature. == Properties in Jenkins Core NOTE: Due to the very large number of system properties used, often just added as a "safety valve" or "escape hatch" in case a change causes problems, this list is not expected to be complete. ===== name: debug.YUI `development` `development` \*Since\*: December 2006 // https://github.com/jenkinsci/jenkins/commit/ab68a9fce7672649b797ea6ff46f88c965e2404b \*Default\*: `false` \*Description\*:: Whether to use the minified (`false`) or debug (`true`) JS files for the YUI library. ===== name: executable-war `packaging` \*Default\*: Path to `jenkins.war` when invoked as `java -jar jenkins.war`, undefined otherwise. \*Description\*:: This is the path to `jenkins.war` and set by `executable.Main` when invoked using `java -jar jenkins.war`. This allows Jenkins to find its own `.war` file and e.g. replace it to apply an update. If undefined, Jenkins will not e.g. offer to update itself. ===== name: hudson.bundled.plugins `development` \*Default\*: undefined \*Description\*:: Specify a location for additional bundled plugins during plugin development (`hpi:run`). There is no reason this would be set by an administrator. ===== name: hudson.ClassicPluginStrategy.noBytecodeTransformer `escape hatch` `obsolete` \*Default\*: `false` \*Since\*: 1.538 // https://github.com/jenkinsci/jenkins/commit/f98c4627da3c21e37aff82c75c0ef7240e60b4da \*Description\*:: Disable the bytecode transformer that retains compatibility at runtime after changing public Java APIs. Has no effect since 2.296, as the bytecode transformer has been removed. ===== name: hudson.ClassicPluginStrategy.useAntClassLoader `escape hatch` \*Default\*: `false` (until 2.309 and since 2.348), `true` (from 2.310 to 2.347) \*Since\*: 1.316 // Unused since https://github.com/jenkinsci/jenkins/commit/47de54d070f67af95b4fefb6d006a72bb31a5cb8 // Restored and default in https://github.com/jenkinsci/jenkins/pull/5698 // Disabled since https://github.com/jenkinsci/jenkins/pull/6571 | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.03675076737999916,
0.09324771910905838,
0.062147416174411774,
0.05699074640870094,
0.05313805490732193,
-0.008507213555276394,
-0.022761773318052292,
-0.03848806023597717,
-0.023003090173006058,
0.005131762009114027,
-0.0034231948666274548,
-0.009561711922287941,
-0.004571682773530483,
... | 0.104971 |
after changing public Java APIs. Has no effect since 2.296, as the bytecode transformer has been removed. ===== name: hudson.ClassicPluginStrategy.useAntClassLoader `escape hatch` \*Default\*: `false` (until 2.309 and since 2.348), `true` (from 2.310 to 2.347) \*Since\*: 1.316 // Unused since https://github.com/jenkinsci/jenkins/commit/47de54d070f67af95b4fefb6d006a72bb31a5cb8 // Restored and default in https://github.com/jenkinsci/jenkins/pull/5698 // Disabled since https://github.com/jenkinsci/jenkins/pull/6571 \*Description\*:: Unused between 1.527 and 2.309. Since 2.310, can be set to `false` to use `URLClassLoader` instead. This is the default since 2.347. ===== name: hudson.cli.CLI.pingInterval `tuning` \*Default\*: `3000` \*Since\*: 2.199 \*Description\*:: Client-side HTTP CLI ping interval in milliseconds. Set on the CLI client (`java -jar jenkins-cli.jar`), not Jenkins server process. ===== name: hudson.ConsoleNote.INSECURE `escape hatch` `security` \*Default\*: `false` \*Since\*: 2.44 / 2.32.2 \*Description\*:: Whether to load unsigned console notes. See SECURITY-382 on link:https://www.jenkins.io/security/advisory/2017-02-01///persisted-cross-site-scripting-vulnerability-in-console-notes[Jenkins Security Advisory 2017-02-01]. ===== name: hudson.consoleTailKB `tuning` \*Default\*: `150` \*Since\*: March 2009 // https://github.com/jenkinsci/jenkins/commit/bf81f96ab3d5e90bca0963c51c40a62d2642548d \*Description\*:: How many KB of console log to show in default console view. This property had no effect from Jenkins 2.4 (inclusive) until 2.98/2.89.3 (exclusive), see JENKINS-48593. ===== name: hudson.diagnosis.HudsonHomeDiskUsageChecker.freeSpaceThreshold `tuning` \*Default\*: `1073741824` (1 GB, up to 2.39), `10737418240` (10 GB, from 2.40) \*Since\*: 1.339 \*Description\*:: If there's less than this amount of free disk space, in bytes, on the disk with the Jenkins home directory, and the disk is 90% or more full, a warning will be shown to administrators. ===== name: hudson.diyChunking `feature` \*Default\*: `false` \*Since\*: May 2009 // https://github.com/jenkinsci/jenkins/commit/703c50cf62dedfb7085d345ec102df7395cf7fca \*Description\*:: Set to `true` if the servlet container doesn't support chunked encoding. ===== name: hudson.DNSMultiCast.disabled `escape hatch` `obsolete` \*Default\*: `false` until 2.218, `true` in 2.219 \*Since\*: 1.359 \*Description\*:: Set to `true` to disable DNS multicast. Has no effect since 2.220 as the feature has been removed. See link:https://www.jenkins.io/security/advisory/2020-01-29///SECURITY-1641[SECURITY-1641] ===== name: hudson.FilePath.VALIDATE\_ANT\_FILE\_MASK\_BOUND `tuning` \*Default\*: `10000` \*Since\*: 1.592 \*Description\*:: Max. number of operations to validate a file mask (e.g. pattern to archive artifacts). ===== name: hudson.footerURL `feature` \*Default\*: `+https://jenkins.io+` \*Since\*: 1.416 \*Description\*:: Allows tweaking the URL displayed at the bottom of Jenkins' UI ===== name: hudson.Functions.autoRefreshSeconds `obsolete` `tuning` \*Default\*: `10` \*Since\*: 1.365 \*Description\*:: Number of seconds between reloads when Auto Refresh is enabled. Obsolete since the feature was removed in Jenkins 2.223. ===== name: hudson.Functions.hidingPasswordFields `security` `escape hatch` \*Default\*: `true` \*Since\*: 2.205 \*Description\*:: Jenkins 2.205 and newer attempts to prevent browsers from offering to autofill password form fields by using a custom password control. Setting this to `false` reverts to the legacy behavior of using mostly standard password form fields. ===== name: hudson.lifecycle `packaging` \*Default\*: automatically determined based on environment, see `hudson.lifecycle.Lifecycle` \*Description\*:: Specify full class name for Lifecycle implementation to override default. See xref:dev-docs:extensions:jenkins-core.adoc#lifecycle[documentation] for class names. ===== name: hudson.logging.LogRecorderManager.skipPermissionCheck `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.121.3 and 2.138 \*Description\*:: Disable security hardening for LogRecorderManager Stapler access. Possibly unsafe, link:https://www.jenkins.io/security/advisory/2018-12-05///SECURITY-595[see 2018-12-05 security advisory]. ===== name: hudson.Main.development `development` \*Default\*: `false` in production, `true` in development \*Description\*:: This is set to `true` by the development tooling to identify when Jenkins is running via `jetty:run` or `hpi:run`. Can be used to distinguish between development and production use; most prominently used to bypass the setup wizard when running with an empty Jenkins home directory during development. ===== name: hudson.Main.timeout `tuning` \*Default\*: `15000` \*Description\*:: When using `jenkins-core.jar` from the CLI, this is the connection timeout connecting to Jenkins to report a build result. ===== name: hudson.markup.MarkupFormatter.previewsAllowGET `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.263.2 / 2.275 \*Description\*:: Controls whether URLs implementing markup formatter previews are accessible via GET. See link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-2153[2021-01-13 security advisory]. ===== name: hudson.markup.MarkupFormatter.previewsSetCSP `security` `escape hatch` \*Default\*: `true` \*Since\*: 2.263.2 / 2.275 \*Description\*:: Controls whether to set restrictive Content-Security-Policy headers on URLs implementing markup formatter previews. See link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-2153[2021-01-13 security advisory]. ===== name: hudson.matrix.MatrixConfiguration.useShortWorkspaceName // TODO | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.08066773414611816,
0.05833692103624344,
0.057002611458301544,
0.025512846186757088,
0.004224381409585476,
-0.03951571136713028,
-0.08611805737018585,
-0.058660414069890976,
0.014440779574215412,
-0.022015968337655067,
-0.06094968691468239,
0.0222347229719162,
-0.03184821084141731,
0.022... | 0.005685 |
Controls whether URLs implementing markup formatter previews are accessible via GET. See link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-2153[2021-01-13 security advisory]. ===== name: hudson.markup.MarkupFormatter.previewsSetCSP `security` `escape hatch` \*Default\*: `true` \*Since\*: 2.263.2 / 2.275 \*Description\*:: Controls whether to set restrictive Content-Security-Policy headers on URLs implementing markup formatter previews. See link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-2153[2021-01-13 security advisory]. ===== name: hudson.matrix.MatrixConfiguration.useShortWorkspaceName // TODO move to matrix-project plugin documentation `feature` \*Default\*: `false` \*Description\*:: Use shorter but cryptic names in matrix build workspace directories. Avoids problems with 256-character limit on paths in Cygwin, path depths problems on Windows, and shell metacharacter problems with label expressions on most platforms. See https://issues.jenkins.io/browse/JENKINS-25783[JENKINS-25783]. ===== name: hudson.model.AbstractItem.skipPermissionCheck `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.121.3 / 2.138 \*Description\*:: Disable security hardening related to Stapler routing for AbstractItem. Possibly unsafe, link:https://www.jenkins.io/security/advisory/2018-12-05///SECURITY-595[see 2018-12-05 security advisory]. ===== name: hudson.model.Api.INSECURE `security` `escape hatch` `obsolete` \*Default\*: `false` \*Since\*: 1.502 \*Description\*:: Set to `true` to permit accessing the Jenkins remote API in an unsafe manner. See SECURITY-47. Deprecated, use e.g. https://plugins.jenkins.io/secure-requester-whitelist/[Secure Requester Whitelist] instead. ===== name: hudson.model.AsyncAperiodicWork.logRotateMinutes `tuning` \*Default\*: `1440` \*Since\*: 1.651 \*Description\*:: The number of minutes after which to try and rotate the log file used by any AsyncAperiodicWork extension. For fine-grained control of a specific extension you can use the `\_FullyQualifiedClassName\_.logRotateMinutes` system property to only affect a specific extension. \_It is not anticipated that you will ever need to change these defaults.\_ ===== name: hudson.model.AsyncAperiodicWork.logRotateSize `tuning` \*Default\*: `-1` \*Since\*: 1.651 \*Description\*:: When starting a new run of any AsyncAperiodicWork extension, if this value is non-negative and the existing log file is larger than the specified number of bytes then the log file will be rotated. For fine-grained control of a specific extension you can use the `\_FullyQualifiedClassName\_.logRotateSize` system property to only affect a specific extension. \_It is not anticipated that you will ever need to change these defaults.\_ ===== name: hudson.model.AsyncPeriodicWork.logRotateMinutes `tuning` \*Default\*: `1440` \*Since\*: 1.651 \*Description\*:: The number of minutes after which to try and rotate the log file used by any AsyncPeriodicWork extension. For fine-grained control of a specific extension you can use the `\_FullyQualifiedClassName\_.logRotateMinutes` system property to only affect a specific extension. \_It is not anticipated that you will ever need to change these defaults.\_ Some implementations that can be individually configured (see \_FullyQualifiedClassName\_ above): \* `hudson.model.WorkspaceCleanupThread` \* `hudson.model.FingerprintCleanupThread` \* `hudson.slaves.ConnectionActivityMonitor` \* `jenkins.DailyCheck` \* `jenkins.model.BackgroundGlobalBuildDiscarder` \* `jenkins.telemetry.Telemetry$TelemetryReporter` ===== name: hudson.model.AsyncPeriodicWork.logRotateSize `tuning` \*Default\*: `-1` \*Since\*: 1.651 \*Description\*:: When starting a new run of any AsyncPeriodicWork extension, if this value is non-negative and the existing log file is larger than the specified number of bytes then the log file will be rotated. For fine-grained control of a specific extension you can use the `\_FullyQualifiedClassName\_.logRotateSize` system property to only affect a specific extension. \_It is not anticipated that you will ever need to change these defaults\_ Some implementations that can be individually configured (see \_FullyQualifiedClassName\_ above): \* `hudson.model.WorkspaceCleanupThread` \* `hudson.model.FingerprintCleanupThread` \* `hudson.slaves.ConnectionActivityMonitor` \* `jenkins.DailyCheck` \* `jenkins.model.BackgroundGlobalBuildDiscarder` \* `jenkins.telemetry.Telemetry$TelemetryReporter` ===== name: hudson.model.DirectoryBrowserSupport.allowAbsolutePath `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.315 and 2.303.2 \*Description\*:: Escape hatch for link:https://www.jenkins.io/security/advisory/2021-10-06///SECURITY-2481[SECURITY-2481]. Set this to `true` to allow browsing to absolute paths. ===== name: hudson.model.DirectoryBrowserSupport.allowSymlinkEscape `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.154 and 2.138.4 \*Description\*:: Escape hatch for link:https://www.jenkins.io/security/advisory/2018-12-05///SECURITY-904[SECURITY-904] and link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-1452[SECURITY-1452]. ===== name: hudson.model.DirectoryBrowserSupport.allowTmpEscape `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.394 and 2.375.4 \*Description\*:: Escape hatch for link:https://www.jenkins.io/security/advisory/2023-03-08///SECURITY-1807[SECURITY-1807]. ===== name: hudson.model.DirectoryBrowserSupport.CSP `security` `escape hatch` \*Default\*: `sandbox; default-src 'none'; image-src 'self'; style-src 'self';` \*Since\*: 1.625.3, 1.641 \*Description\*:: Determines the Content Security Policy header sent for static files served by Jenkins. Only affects instances that don't have a resource root URL set up. See xref:system-administration:configuring-content-security-policy.adoc[Configuring Content Security Policy] for more details. ===== name: hudson.model.DownloadService$Downloadable.defaultInterval `tuning` \*Default\*: `86400000` (1 day) \*Since\*: '1.500' \*Description\*:: Interval | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.03472078591585159,
0.07742909342050552,
-0.06139610335230827,
0.03792763501405716,
-0.018757477402687073,
0.019516510888934135,
-0.09251221269369125,
-0.09095481038093567,
-0.017983732745051384,
0.03399460017681122,
-0.02850148268043995,
-0.011861227452754974,
0.010387737303972244,
0.03... | -0.011973 |
'self';` \*Since\*: 1.625.3, 1.641 \*Description\*:: Determines the Content Security Policy header sent for static files served by Jenkins. Only affects instances that don't have a resource root URL set up. See xref:system-administration:configuring-content-security-policy.adoc[Configuring Content Security Policy] for more details. ===== name: hudson.model.DownloadService$Downloadable.defaultInterval `tuning` \*Default\*: `86400000` (1 day) \*Since\*: '1.500' \*Description\*:: Interval between periodic downloads of \_Downloadables\_, typically tool installer metadata. ===== name: hudson.model.DownloadService.never `obsolete` `escape hatch` \*Default\*: `false` \*Since\*: 1.319 // https://github.com/jenkinsci/jenkins/commit/163c08003eb25cbe259fc8a8277bb3e264e36d18 \*Description\*:: Suppress the periodic download of data files for plugins via browser-based download. Since Jenkins 2.200, this has no effect. ===== name: hudson.model.DownloadService.noSignatureCheck `security` `escape hatch` \*Default\*: `false` \*Since\*: 1.482 // https://github.com/jenkinsci/jenkins/commit/62f66f899c95ccdfdc7a5d3346240988b42a9aad \*Description\*:: Skip the update site signature check. Setting this to `true` can be unsafe. ===== name: hudson.model.Hudson.flyweightSupport `obsolete` `feature` `escape hatch` \*Default\*: `false` before 1.337; `true` from 1.337; unused since 1.598 \*Since\*: 1.318 \*Description\*:: Matrix parent job and other flyweight tasks (e.g. Build Flow plugin) won't consume an executor when `true`. Unused since 1.598, flyweight support is now always enabled. ===== name: hudson.model.Hudson.initLogLevel `obsolete` \*Description\*:: Deprecated: Backward-compatible fallback for `jenkins.model.Jenkins.initLogLevel`. Removed since 2.272. ===== name: hudson.model.Hudson.killAfterLoad `obsolete` \*Description\*:: Deprecated: Backward-compatible fallback for `jenkins.model.Jenkins.killAfterLoad`. Removed since 2.272. ===== name: hudson.model.Hudson.logStartupPerformance `obsolete` \*Description\*:: Deprecated: Backward-compatible fallback for `jenkins.model.Jenkins.logStartupPerformance`. Removed since 2.272. ===== name: hudson.model.Hudson.parallelLoad `obsolete` \*Description\*:: Deprecated: Backward-compatible fallback for `jenkins.model.Jenkins.parallelLoad`. Removed since 2.272. ===== name: hudson.model.Hudson.workspaceDirName `obsolete` \*Description\*:: Deprecated: Backward-compatible fallback for `jenkins.model.Jenkins.workspaceDirName`. Removed since 2.272. ===== name: hudson.model.LabelAtom.allowFolderTraversal `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.263.2 / 2.275 \*Description\*:: Controls whether label names containing unsafe characters that lead to path traversal can be saved. See link:https://www.jenkins.io/doc/upgrade-guide/2.263///labelatom[2.263.2 upgrade guide]. ===== name: hudson.model.LoadStatistics.clock `tuning` \*Default\*: `10000` (10 seconds) \*Since\*: January 2009 // https://github.com/jenkinsci/jenkins/commit/8d771bc2e335fea5369ba06066c87866494fa5e3 \*Description\*:: Load statistics clock cycle in milliseconds. ===== name: hudson.model.LoadStatistics.decay `tuning` \*Default\*: `0.9` \*Since\*: January 2009 // https://github.com/jenkinsci/jenkins/commit/8d771bc2e335fea5369ba06066c87866494fa5e3 \*Description\*:: Decay ratio for every clock cycle in node utilization charts. ===== name: hudson.model.MultiStageTimeSeries.chartFont `feature` `ui` \*Default\*: `SansSerif-10` \*Since\*: 1.562 \*Description\*:: Font used for load statistics. See http://docs.oracle.com/javase/7/docs/api/java/awt/Font.html//decode%28java.lang.String%29[Java documentation] on how the value is decoded. ===== name: hudson.model.Node.SKIP\_BUILD\_CHECK\_ON\_FLYWEIGHTS `security` `escape hatch` \*Default\*: `true` \*Since\*: 2.111 // https://github.com/jenkinsci/jenkins/commit/036e0ce6bb0f257c1e90d49a0af907adf6bb79f7 \*Description\*:: Whether to allow building flyweight tasks even if the necessary permission (Computer/Build) is missing. See https://issues.jenkins.io/browse/JENKINS-46652[JENKINS-46652]. ===== name: hudson.model.ParametersAction.keepUndefinedParameters `security` `escape hatch` \*Default\*: undefined \*Since\*: 1.651.2 / 2.3 // TODO add advisory reference \*Description\*:: If true, not discard parameters for builds that are not defined on the job. \*Enabling this can be unsafe.\* Since Jenkins 2.40, if set to false, will not log a warning message that parameters were defined but ignored. ===== name: hudson.model.ParametersAction.safeParameters `security` `escape hatch` \*Default\*: undefined \*Since\*: 1.651.2 / 2.3 // TODO add advisory reference \*Description\*:: Comma-separated list of additional build parameter names that should not be discarded even when not defined on the job. ===== name: hudson.model.Queue.cacheRefreshPeriod `tuning` \*Default\*: `1000` \*Since\*: 1.577 up to 1.647 \*Description\*:: Defines the refresh period for the internal queue cache (in milliseconds). The greater period workarounds web UI delays on large installations, which may be caused by locking of the build queue by build executors. Downside: Builds appear in the queue with a noticeable delay. ===== name: hudson.model.Queue.Saver.DELAY\_SECONDS `tuning` \*Default\*: `60` \*Since\*: 2.109 \*Description\*:: Maximal delay of a save operation when content of Jenkins queue changes. This works as a balancing factor between queue consistency guarantee in case of Jenkins crash (short delay) and decreasing IO activity based on Jenkins load (long delay). ===== name: hudson.model.Run.ArtifactList.listCutoff `tuning` `ui` \*Default\*: `16` \*Since\*: 1.330 \*Description\*:: More artifacts than this will use tree view or simple link rather than listing out artifacts ===== name: hudson.model.Run.ArtifactList.treeCutoff `tuning` `ui` \*Default\*: `40` \*Since\*: 1.330 \*Description\*:: More artifacts than this will show a simple link to directory browser | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.00640505226328969,
0.014907436445355415,
-0.015060347504913807,
-0.000716116395778954,
0.029298385605216026,
-0.08195450901985168,
0.012809069827198982,
-0.03613455221056938,
0.06571538746356964,
0.023531414568424225,
-0.006997750606387854,
-0.03592965006828308,
-0.0101987449452281,
0.0... | 0.073235 |
(long delay). ===== name: hudson.model.Run.ArtifactList.listCutoff `tuning` `ui` \*Default\*: `16` \*Since\*: 1.330 \*Description\*:: More artifacts than this will use tree view or simple link rather than listing out artifacts ===== name: hudson.model.Run.ArtifactList.treeCutoff `tuning` `ui` \*Default\*: `40` \*Since\*: 1.330 \*Description\*:: More artifacts than this will show a simple link to directory browser rather than showing artifacts in tree view ===== name: hudson.model.Slave.workspaceRoot `tuning` \*Default\*: `workspace` \*Since\*: 1.341? \*Description\*:: name of the folder within the agent root directory to contain workspaces ===== name: hudson.model.UpdateCenter.className `packaging` \*Default\*: effectively `hudson.model.UpdateCenter` \*Since\*: 2.4 \*Description\*:: This allows overriding the implementation class for update center when customizing the `.war` packaging of Jenkins. Cannot be used for plugins. ===== name: hudson.model.UpdateCenter.defaultUpdateSiteId \*Default\*: `default` \*Since\*: 2.4 // TODO figure out what this even does, IIRC Jenkins doesn't care about the ID other than distinguish on the UI? \*Description\*:: Configure a different ID for the default update site. Useful for custom war distributions or externally provided UC data files. ===== name: hudson.model.UpdateCenter.never \*Default\*: `false` \*Description\*:: When true, don't automatically check for new versions ===== name: hudson.model.UpdateCenter.pluginDownloadReadTimeoutSeconds `tuning` \*Default\*: `60` \*Description\*:: Read timeout in seconds for downloading plugins. ===== name: hudson.model.UpdateCenter.skipPermissionCheck `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.121.3 / 2.138 \*Description\*:: Disable security hardening related to Stapler routing for UpdateCenter. Possibly unsafe, link:https://www.jenkins.io/security/advisory/2018-12-05///SECURITY-595[see 2018-12-05 security advisory]. ===== name: hudson.model.UpdateCenter.updateCenterUrl `obsolete` \*Default\*: `+https://updates.jenkins.io/+` \*Description\*:: Deprecated: Override the default update site URL. May have no effect since Jenkins 1.333. ===== name: hudson.model.UsageStatistics.disabled `feature` \*Default\*: `false` \*Since\*: May 2009 // https://github.com/jenkinsci/jenkins/commit/49ace47432e473b8f5febb6cc00f177be5854ffb looks like a rename // but it was originally added the same day https://github.com/jenkinsci/jenkins/commit/10cc0441aeaf7c042dc1ecca674a7cf9b8375863 just a typo \*Description\*:: Set to `true` to opt out of usage statistics collection, independent of UI option. ===== name: hudson.model.User.allowNonExistentUserToLogin `security` `escape hatch` \*Default\*: `false` \*Since\*: 1.602 \*Description\*:: When `true`, does not check auth realm for existence of user if there's a record in Jenkins. Unsafe, but may be used on some instances for service accounts ===== name: hudson.model.User.allowUserCreationViaUrl `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.44 / 2.32.2 \*Description\*:: Whether admins accessing `/user/example` creates a user record (see SECURITY-406 on https://wiki.jenkins.io/display/SECURITY/Jenkins+Security+Advisory+2017-02-01[Jenkins Security Advisory 2017-02-01]) ===== name: hudson.model.User.SECURITY\_243\_FULL\_DEFENSE `security` `escape hatch` \*Default\*: `true` \*Since\*: 1.651.2 / 2.3 \*Description\*:: When false, skips part of the fix that tries to determine whether a given user ID exists, and if so, doesn't consider users with the same full name during resolution. ===== name: hudson.model.User.skipPermissionCheck `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.121.3 / 2.138 \*Description\*:: Disable security hardening related to Stapler routing for User. Possibly unsafe, link:https://www.jenkins.io/security/advisory/2018-12-05///SECURITY-595[see 2018-12-05 security advisory]. ===== name: hudson.model.WorkspaceCleanupThread.disabled `escape hatch` \*Default\*: `false` \*Since\*: June 2009 // https://github.com/jenkinsci/jenkins/commit/ee5cba8fac256580ac30878ed28cf3330cc9d4a4 \*Description\*:: Don't clean up old workspaces on agent nodes ===== name: hudson.model.WorkspaceCleanupThread.recurrencePeriodHours `tuning` \*Default\*: `24` \*Since\*: 1.608 \*Description\*:: How frequently workspace cleanup should run, in hours. ===== name: hudson.model.WorkspaceCleanupThread.retainForDays `tuning` \*Default\*: `30` \*Since\*: 1.608 \*Description\*:: Unused workspaces are retained for this many days before qualifying for deletion. ===== name: hudson.node\_monitors.AbstractNodeMonitorDescriptor.periodMinutes `tuning` \*Default\*: `60` (1 hour) \*Description\*:: How frequently to update node monitors by default, in minutes. ===== name: hudson.PluginManager.checkUpdateAttempts `tuning` \*Default\*: `1` \*Since\*: 2.152 \*Description\*:: Number of attempts to check the updates sites. ===== name: hudson.PluginManager.checkUpdateSleepTimeMillis `tuning` \*Default\*: `1000` \*Since\*: 2.152 \*Description\*:: Time (milliseconds) elapsed between retries to check the updates sites. ===== name: hudson.PluginManager.className `packaging` \*Default\*: effectively `hudson.LocalPluginManager` \*Description\*:: Can be used to specify a different `PluginManager` implementation when customizing the `.war` packaging of Jenkins. Cannot be used for plugins. ===== name: hudson.PluginManager.noFastLookup `escape hatch` \*Default\*: `false` \*Description\*:: Disable fast lookup using `ClassLoaderReflectionToolkit` which reflectively accesses internal methods of `ClassLoader`. ===== name: hudson.PluginManager.skipPermissionCheck `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.121.3 / 2.138 \*Description\*:: Disable security hardening related to Stapler routing for | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
0.03700435906648636,
0.014261146076023579,
0.041169509291648865,
0.055211689323186874,
0.02785157971084118,
-0.06418558210134506,
-0.06772775202989578,
-0.029878299683332443,
-0.05852155014872551,
0.020548110827803612,
-0.008924147114157677,
-0.09494466334581375,
-0.03437433019280434,
0.02... | 0.015291 |
`.war` packaging of Jenkins. Cannot be used for plugins. ===== name: hudson.PluginManager.noFastLookup `escape hatch` \*Default\*: `false` \*Description\*:: Disable fast lookup using `ClassLoaderReflectionToolkit` which reflectively accesses internal methods of `ClassLoader`. ===== name: hudson.PluginManager.skipPermissionCheck `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.121.3 / 2.138 \*Description\*:: Disable security hardening related to Stapler routing for PluginManager. Possibly unsafe, link:https://www.jenkins.io/security/advisory/2018-12-05///SECURITY-595[see 2018-12-05 security advisory]. ===== name: hudson.PluginManager.workDir `feature` \*Default\*: undefined \*Since\*: 1.649 \*Description\*:: Location of the base directory for all exploded .hpi/.jpi plugins. By default, the plugins will be extracted under `$JENKINS\_HOME/plugins/`. ===== name: hudson.PluginStrategy `packaging` \*Default\*: effectively `hudson.ClassicPluginStrategy` \*Description\*:: Allow plugins to be loaded into a different environment, such as an existing DI container like Plexus. Specify the full class name of a `hudson.PluginStrategy` implementation to override the default. ===== name: hudson.PluginWrapper.dependenciesVersionCheck.enabled `escape hatch` \*Default\*: `true` \*Since\*: 2.0 \*Description\*:: Set to `false` to skip the version check for plugin dependencies. ===== name: hudson.ProxyConfiguration.DEFAULT\_CONNECT\_TIMEOUT\_MILLIS `tuning` \*Default\*: `20000` \*Since\*: 2.0 \*Description\*:: Connection timeout applied to connections e.g. to the update site. [#hudson-remoting-channelbuilder-allcallablescanignorerolechecker] ===== name: hudson.remoting.ChannelBuilder.allCallablesCanIgnoreRoleChecker `security` `scape hatch` \*Default\*: `false` \*Since\*: 2.319 and 2.303.3 \*Description\*:: Disable requirement for remoting callables to perform a role check. See link:https://www.jenkins.io/doc/upgrade-guide/2.303///SECURITY-2458[the description in the upgrade guide]. [#hudson-remoting-channelbuilder-specificcallablescanignoreroleche] ===== name: hudson.remoting.ChannelBuilder.specificCallablesCanIgnoreRoleChecker `security` `scape hatch` \*Default\*: undefined \*Since\*: 2.319 and 2.303.3 \*Description\*:: Comma-separated list of class names allowed to bypass role check requirement. See link:https://www.jenkins.io/doc/upgrade-guide/2.303///SECURITY-2458[the description in the upgrade guide]. ===== name: hudson.remoting.ClassFilter `security` `escape hatch` \*Default\*: undefined \*Description\*:: Allow or disallow the deserialization of specified types. Comma-separated class names, entries are whitelisted unless prefixed with `!`. See {jep}200/backwards-compatibility[JEP-200] and https://issues.jenkins.io/browse/JENKINS-47736[JENKINS-47736]. ===== name: hudson.scheduledRetention `obsolete` // TODO figure out what this does \*Default\*: `false` \*Since\*: Up to 1.354 \*Description\*:: Control an agent based on a schedule ===== name: hudson.scm.SCM.useAutoBrowserHolder `feature` \*Default\*: `false` since Jenkins 2.9, `true` before \*Description\*:: When set to `true`, Jenkins will guess the repository browser used to render links in the changelog. ===== name: hudson.script.noCache `development` \*Default\*: `false` in production, `true` during development \*Description\*:: When set to true, Jenkins will not reference resource files through the `/static/.../` URL space, preventing their caching. This is set to `true` during development by default, and `false` otherwise. ===== name: hudson.search.Search.MAX\_SEARCH\_SIZE `security` `escape hatch` \*Default\*: `500` \*Since\*: 2.375.4 / 2.394 \*Description\*:: Limits the number of results a search can render. ===== name: hudson.search.Search.skipPermissionCheck `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.121.3 / 2.138 \*Description\*:: Disable security hardening related to Stapler routing for Search. Possibly unsafe, link:https://www.jenkins.io/security/advisory/2018-12-05///SECURITY-595[see 2018-12-05 security advisory]. ===== name: hudson.security.AccessDeniedException2.REPORT\_GROUP\_HEADERS `escape hatch` \*Default\*: `false` \*Since\*: 2.46 / 2.32.3 \*Description\*:: If set to true, restore pre-2.46 behavior of sending HTTP headers on "access denied" pages listing group memberships. ===== name: hudson.security.ArtifactsPermission `security` `escape hatch` \*Default\*: `false` \*Since\*: 1.374 \*Description\*:: The Artifacts permission allows to control access to artifacts; When this property is unset or set to false, access to artifacts is not controlled ===== name: hudson.security.csrf.CrumbFilter.UNPROCESSED\_PATHINFO `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.228 and 2.204.6 \*Description\*:: Escape hatch for link:https://www.jenkins.io/security/advisory/2020-03-25///SECURITY-1774[SECURITY-1774]. ===== name: hudson.security.csrf.DefaultCrumbIssuer.EXCLUDE\_SESSION\_ID `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.186 and 2.176.2 \*Description\*:: Escape hatch for link:https://www.jenkins.io/security/advisory/2019-07-17///SECURITY-626[SECURITY-626]. ===== name: hudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE\_CSRF\_PROTECTION `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.222 \*Description\*:: Restore the ability to disable CSRF protection after the UI for doing so was removed from Jenkins 2.222. ===== name: hudson.security.csrf.requestfield `security` `tuning` \*Default\*: `.crumb` (Jenkins 1.x), `Jenkins-Crumb` (Jenkins 2.0) \*Since\*: 1.310 \*Description\*:: Parameter name that contains a crumb value on POST requests ===== name: hudson.security.ExtendedReadPermission `security` `feature` \*Default\*: `false` \*Since\*: 1.324 \*Description\*:: The ExtendedReadPermission allows read-only access to "Configure" pages; can also enable with extended-read-permission plugin ===== name: hudson.security.HudsonPrivateSecurityRealm.ID\_REGEX `security` `escape hatch` \*Default\*: `+[a-zA-Z0-9\_-]++` \*Since\*: 2.121 and 2.107.3 \*Description\*:: Regex for legal usernames in Jenkins user | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.08943086862564087,
0.050689131021499634,
-0.01182124949991703,
0.0012555395951494575,
-0.03258224576711655,
-0.05146674066781998,
-0.049825701862573624,
-0.07564368098974228,
-0.052015725523233414,
-0.016333244740962982,
0.05333159118890762,
-0.01956949383020401,
-0.0716426745057106,
0.... | 0.032526 |
a crumb value on POST requests ===== name: hudson.security.ExtendedReadPermission `security` `feature` \*Default\*: `false` \*Since\*: 1.324 \*Description\*:: The ExtendedReadPermission allows read-only access to "Configure" pages; can also enable with extended-read-permission plugin ===== name: hudson.security.HudsonPrivateSecurityRealm.ID\_REGEX `security` `escape hatch` \*Default\*: `+[a-zA-Z0-9\_-]++` \*Since\*: 2.121 and 2.107.3 \*Description\*:: Regex for legal usernames in Jenkins user database. See link:https://www.jenkins.io/security/advisory/2018-05-09///SECURITY-786[SECURITY-786]. ===== name: hudson.security.HudsonPrivateSecurityRealm.maximumBCryptLogRound `security` `escape hatch` \*Default\*: `18` \*Since\*: 2.161 \*Description\*:: Limits the number of rounds for pre-computed BCrypt hashes of user passwords for the Jenkins user database to prevent excessive computation. ===== name: hudson.security.LDAPSecurityRealm.groupSearch // TODO move out, it's LDAP plugin // def: TODO recover default that was apparently lost after wiki \*Description\*:: LDAP filter to look for groups by their names ===== name: hudson.security.SecurityRealm.sessionFixationProtectionMode `security` `escape hatch` \*Default\*: `1` \*Since\*: 2.300 and 2.289.2 \*Description\*:: Escape hatch for link:https://www.jenkins.io/security/advisory/2021-06-30///SECURITY-2371[SECURITY-2371]. Set to `0` to disable the fix or to `2` to select an alternative implementation. ===== name: hudson.security.TokenBasedRememberMeServices2.skipTooFarExpirationDateCheck `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.160 and 2.150.2 \*Description\*:: Escape hatch for link:https://www.jenkins.io/security/advisory/2019-01-16///SECURITY-868[SECURITY-868] ===== name: hudson.security.WipeOutPermission `security` `feature` \*Default\*: `false` \*Since\*: 1.416 \*Description\*:: The WipeOut permission allows to control access to the "Wipe Out Workspace" action, which is normally available as soon as the Build permission is granted ===== name: hudson.slaves.ChannelPinger.pingInterval `tuning` `obsolete` \*Default\*: `5` \*Since\*: 1.405 \*Description\*:: Frequency (in minutes) of https://wiki.jenkins.io/display/JENKINS/Ping+Thread[pings between the controller and agents]. Deprecated since 2.37, use `hudson.slaves.ChannelPinger.pingIntervalSeconds` instead. ===== name: hudson.slaves.ChannelPinger.pingIntervalSeconds `tuning` \*Default\*: `300` \*Since\*: 2.37 \*Description\*:: Frequency of https://wiki.jenkins.io/display/JENKINS/Ping+Thread[pings between the controller and agents], in seconds ===== name: hudson.slaves.ChannelPinger.pingTimeoutSeconds `tuning` \*Default\*: `240` \*Since\*: 2.37 \*Description\*:: Timeout for each https://wiki.jenkins.io/display/JENKINS/Ping+Thread[ping between the controller and agents], in seconds ===== name: hudson.slaves.ConnectionActivityMonitor.enabled `feature` // TODO: This looks like a dead feature? Introduced 2011 and disabled by default? \*Default\*: `false` \*Since\*: 1.326 \*Description\*:: Whether to enable this feature that checks whether agents are alive and cuts them off if not. ===== name: hudson.slaves.ConnectionActivityMonitor.frequency `tuning` // TODO: Actually dual use: Both for timeout (4 minutes) and time to ping (3 minutes). Possibly copy & paste issue and bug in core? \*Default\*: `10000` (10 seconds) \*Since\*: 1.326 \*Description\*:: How frequently to check for channel activity, in milliseconds. ===== name: hudson.slaves.ConnectionActivityMonitor.timeToPing `tuning` \*Default\*: `180000` (3 minutes) \*Since\*: 1.326 \*Description\*:: How long to wait after startup to start checking agent connections, in milliseconds. ===== name: hudson.slaves.NodeProvisioner.initialDelay `tuning` \*Default\*: 10 times `hudson.model.LoadStatistics.clock`, typically 100 seconds \*Description\*:: How long to wait after startup before starting to provision nodes from clouds. This will allow static agents to start and handle the load first. ===== name: hudson.slaves.NodeProvisioner.MARGIN `tuning` ===== name: hudson.slaves.NodeProvisioner.MARGIN0 `tuning` ===== name: hudson.slaves.NodeProvisioner.MARGIN\_DECAY `tuning` ===== name: hudson.slaves.NodeProvisioner.recurrencePeriod `tuning` \*Default\*: Equal to `hudson.model.LoadStatistics.clock`, typically 10 seconds \*Description\*:: How frequently to possibly provision nodes. ===== name: hudson.slaves.SlaveComputer.allowUnsupportedRemotingVersions `escape hatch` \*Default\*: `false` \*Since\*: 2.343 \*Description\*:: Allow connection by agents running unsupported remoting versions. ===== name: hudson.slaves.WorkspaceList `tuning` \*Default\*: `@` \*Since\*: 1.424 \*Description\*:: When concurrent builds is enabled, a unique workspace directory name is required for each concurrent build. To create this name, this token is placed between project name and a unique ID, e.g. "my-project@123". ===== name: hudson.tasks.ArtifactArchiver.warnOnEmpty `feature` \*Default\*: `false` \*Description\*:: When true, builds don't fail when there is nothing to archive ===== name: hudson.tasks.Fingerprinter.enableFingerprintsInDependencyGraph `feature` \*Default\*: `false` \*Since\*: 1.430 \*Description\*:: When true, jobs associated through fingerprints are added to the dependency graph, even when there is no configured upstream/downstream relationship between them. ===== name: hudson.tasks.MailSender.maxLogLines // TODO is this mailer plugin now? \*Default\*: `250` \*Description\*:: Number of lines of console output to include in emails ===== name: hudson.TcpSlaveAgentListener.hostName `feature` \*Default\*: Same as the configured Jenkins root URL \*Description\*:: Host name that Jenkins advertises to inbound TCP agents. Especially useful when running Jenkins | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.007313941605389118,
0.03439268469810486,
-0.030355527997016907,
-0.008605603128671646,
-0.03540213778614998,
-0.058247171342372894,
-0.014024726115167141,
-0.04805067926645279,
-0.032978612929582596,
-0.01938556507229805,
0.0053208512254059315,
-0.01553087867796421,
-0.0009384558070451021... | 0.021799 |
===== name: hudson.tasks.MailSender.maxLogLines // TODO is this mailer plugin now? \*Default\*: `250` \*Description\*:: Number of lines of console output to include in emails ===== name: hudson.TcpSlaveAgentListener.hostName `feature` \*Default\*: Same as the configured Jenkins root URL \*Description\*:: Host name that Jenkins advertises to inbound TCP agents. Especially useful when running Jenkins behind a reverse proxy. ===== name: hudson.TcpSlaveAgentListener.port `feature` \*Default\*: Same as the configured TCP agent port \*Description\*:: Port that Jenkins advertises to inbound TCP agents. Especially useful when running Jenkins behind a reverse proxy. ===== name: hudson.TreeView `feature` `obsolete` \*Default\*: `false` \*Description\*:: Enables the experimental nested views feature. Has no effect since 2.302, as the experimental nested views feature has been removed. ===== name: hudson.triggers.SafeTimerTask.logsTargetDir `feature` \*Default\*: `$JENKINS\_HOME/logs` \*Since\*: 2.114 \*Description\*:: Allows to move the logs usually found under `$JENKINS\_HOME/logs` to another location. Beware that no migration is handled if you change it on an existing instance. ===== name: hudson.triggers.SCMTrigger.starvationThreshold `tuning` \*Default\*: `3600000` (1 hour) \*Description\*:: Milliseconds waiting for polling executor before trigger reports it is clogged. ===== name: hudson.udp `escape hatch` `obsolete` `tuning` \*Default\*: `33848` until 2.218, `-1` in 2.219 \*Description\*:: Port for UDP multicast broadcast. Set to -1 to disable. Has no effect since 2.220 as the feature has been removed. See link:https://www.jenkins.io/security/advisory/2020-01-29///SECURITY-1641[SECURITY-1641] ===== name: hudson.upstreamCulprits `feature` \*Default\*: `false` \*Since\*: 1.327 \*Description\*:: Pass blame information to downstream jobs. ===== name: hudson.util.AtomicFileWriter.DISABLE\_FORCED\_FLUSH `escape hatch` // The code is really confusing; there are two flags, one is always false, and will be forcibly set to false here, except using a new constructor that was deprecated in the same PR it was introduced in. \*Default\*: `false` \*Since\*: 2.102 \*Description\*:: Disables the forced flushing when calling `//close()`. Not expected to be used. ===== name: hudson.util.CharacterEncodingFilter.disableFilter `escape hatch` \*Default\*: `false` \*Description\*:: Set to `true` to disable the filter that sets request encoding to UTF-8 if it's undefined and its content type is `text/xml` or `application/xml` (API submissions). ===== name: hudson.util.CharacterEncodingFilter.forceEncoding `feature` \*Default\*: `false` \*Description\*:: Set to `true` to force the request encoding to UTF-8 even if a different character set is declared. ===== name: hudson.Util.deletionRetryWait `tuning` \*Default\*: `100` \*Since\*: 2.2 \*Description\*:: The time (in milliseconds) to wait between attempts to delete files when retrying. This has no effect unless \_hudson.Util.maxFileDeletionRetries\_ is greater than 1. If zero, there will be no delay between attempts. If negative, the delay will be a (linearly) increasing multiple of this value between attempts. ===== name: hudson.util.Digester2.UNSAFE `security` `escape hatch` `obsolete` \*Default\*: `false` \*Since\*: 2.263.2 / 2.275 \*Description\*:: Opts out of a change in default behavior that disables the processing of XML external entities (XXE) for the `Digester2` class in Jenkins if set to `true`. This system property can be changed while Jenkins is running and the change is effective immediately. See link:https://www.jenkins.io/doc/upgrade-guide/2.263///digester2[2.263.2 upgrade guide]. Has no effect since 2.297, as the `Digester2` class has been removed. ===== name: hudson.util.FormValidation.applyContentSecurityPolicyHeaders `security` `escape hatch` \*Default\*: `true` \*Since\*: 2.263.2 / 2.275 \*Description\*:: Controls whether to set restrictive Content-Security-Policy headers on URLs implementing form validation responses. This reduces the impact of cross-site scripting (XSS) vulnerabilities in form validation output. See link:https://www.jenkins.io/doc/upgrade-guide/2.263///formvalidation[2.263.2 upgrade guide]. ===== name: hudson.util.Graph.maxArea `security` `escape hatch` \*Default\*: `10000000` (10 million) \*Since\*: 2.263.2 / 2.275 \*Description\*:: Controls the maximum size (area) for requests to render graphs like load statistics. See link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-2025[2021-01-13 security advisory]. ===== name: hudson.Util.maxFileDeletionRetries `tuning` \*Default\*: `3` \*Since\*: 2.2 \*Description\*:: The number of times to attempt to delete files/directory trees before giving up and throwing an exception. Specifying a value less than 1 is invalid and will be treated as if a value of 1 (i.e. one attempt, no retries) was specified. See https://issues.jenkins.io/browse/JENKINS-10113[JENKINS-10113] and https://issues.jenkins.io/browse/JENKINS-15331[JENKINS-15331]. ===== name: | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.052911728620529175,
-0.002618097700178623,
0.06740457564592361,
0.012709526345133781,
0.00912079680711031,
-0.14515642821788788,
-0.03586191311478615,
-0.07728677988052368,
0.009501083754003048,
-0.017988741397857666,
-0.10986991226673126,
-0.03197871521115303,
-0.060849037021398544,
0.... | 0.049413 |
2.2 \*Description\*:: The number of times to attempt to delete files/directory trees before giving up and throwing an exception. Specifying a value less than 1 is invalid and will be treated as if a value of 1 (i.e. one attempt, no retries) was specified. See https://issues.jenkins.io/browse/JENKINS-10113[JENKINS-10113] and https://issues.jenkins.io/browse/JENKINS-15331[JENKINS-15331]. ===== name: hudson.util.MultipartFormDataParser.FILEUPLOAD\_MAX\_FILES `escape hatch` `tuning` `security` \*Default\*: `1000` \*Since\*: 2.375.4, 2.394 \*Description\*:: Limits the number of form fields that can be processed in one `multipart/form-data` request. Used to set `org.apache.commons.fileupload.servlet.ServletFileUpload//setFileCountMax(long)`. Despite the name, this applies to all form fields, not just actual file attachments. `-1` disables this limit. ===== name: hudson.util.MultipartFormDataParser.FILEUPLOAD\_MAX\_FILE\_SIZE tags: // Not an escape hatch since it's disabled by default - tuning - security \*Default\*: `-1` \*Since\*: 2.375.4, 2.394 \*Description\*:: Limits the size (in bytes) of individual fields that can be processed in one `multipart/form-data` request. Despite the name, this applies to all form fields, not just actual file attachments. `-1` disables this limit. ===== name: hudson.util.MultipartFormDataParser.FILEUPLOAD\_MAX\_SIZE tags: // Not an escape hatch since it's disabled by default - tuning - security \*Default\*: `-1` \*Since\*: 2.375.4, 2.394 \*Description\*:: Limits the total request size (in bytes) that can be processed in one `multipart/form-data` request. Used to set `org.apache.commons.fileupload.servlet.ServletFileUpload//setSizeMax(long)`. `-1` disables this limit. ===== name: hudson.Util.noSymLink `feature` // TODO this is now in a plugin I think? \*Default\*: `false` \*Description\*:: True to disable creation of symbolic links in job/builds directories ===== name: hudson.Util.performGCOnFailedDelete `tuning` \*Default\*: `false` \*Since\*: 2.2 \*Description\*:: If this flag is set to `true` then we will request a garbage collection after a deletion failure before we next retry the deletion. It is ignored unless \_hudson.Util.maxFileDeletionRetries\_ is greater than 1. Setting this flag to `true` \_may\_ resolve some problems on Windows, and also for directory trees residing on an NFS share, but it can have a negative impact on performance and may have no effect at all (GC behavior is JVM-specific). \*\*Warning\*\*: This should only ever be used if you find that your builds are failing because Jenkins is unable to delete files, that this failure is because Jenkins itself has those files locked "open", and even then it should only be used on agents with relatively few executors (because the garbage collection can impact the performance of all job executors on that agent). \_Setting this flag is an act of last resort - it is not recommended, and should not be used on your main Jenkins server unless you can tolerate the performance impact\_. ===== name: hudson.util.ProcessTree.disable `feature` \*Default\*: `false` \*Description\*:: True to disable cleanup of child processes. ===== name: hudson.util.RingBufferLogHandler.defaultSize `tuning` \*Default\*: `256` \*Since\*: 1.563 \*Description\*:: Number of log entries in loggers available on the UI at `/log/` ===== name: hudson.util.RobustReflectionConverter.recordFailuresForAdmins `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.263.2 / 2.275 \*Description\*:: If set to `true`, Old Data Monitor will record some failures to load data submitted by users with Overall/Administer permission, partially disabling a security fix. See link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-1923[2021-01-13 security advisory] and link:https://www.jenkins.io//hudson-util-robustreflectionconverter-recordfailuresforallauthen[`hudson.util.RobustReflectionConverter.recordFailuresForAllAuthentications`]. ===== name: hudson.util.RobustReflectionConverter.recordFailuresForAllAuthentications `security` `escape hatch` \*Default\*: `false` \*Since\*: 2.263.2 / 2.275 \*Description\*:: If set to `true`, Old Data Monitor will record some failures to load data submitted by all authorized users, completely disabling a security fix. See link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-1923[2021-01-13 security advisory] and link:https://www.jenkins.io//hudson-util-robustreflectionconverter-recordfailuresforadmins[`hudson.util.RobustReflectionConverter.recordFailuresForAdmins`]. ===== name: hudson.util.Secret.AUTO\_ENCRYPT\_PASSWORD\_CONTROL `security` `escape hatch` \*Default\*: `true` \*Since\*: 2.236 \*Description\*:: Jenkins automatically round-trips `f:password` based form fields as encrypted `Secret` even if the field is not of type `Secret`. Set this to `false` to disable this behavior, doing so is discouraged. ===== name: hudson.util.Secret.BLANK\_NONSECRET\_PASSWORD\_FIELDS\_WITHOUT\_ITEM\_CONFIGURE `escape hatch` `security` \*Default\*: `true` \*Since\*: 2.236 \*Description\*:: If the user is missing \_Item/Configure\_ permission, Jenkins 2.236 and newer will blank out the password value automatically even | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.04479441046714783,
0.01792079582810402,
0.045789726078510284,
0.008387592621147633,
0.031586531549692154,
-0.10856691747903824,
-0.05517750233411789,
-0.024028874933719635,
0.08617542684078217,
0.05068662762641907,
-0.03528360649943352,
-0.013247622177004814,
0.021952101960778236,
-0.00... | 0.052654 |
if the field is not of type `Secret`. Set this to `false` to disable this behavior, doing so is discouraged. ===== name: hudson.util.Secret.BLANK\_NONSECRET\_PASSWORD\_FIELDS\_WITHOUT\_ITEM\_CONFIGURE `escape hatch` `security` \*Default\*: `true` \*Since\*: 2.236 \*Description\*:: If the user is missing \_Item/Configure\_ permission, Jenkins 2.236 and newer will blank out the password value automatically even if the form field is not backed by a `Secret`. Set this to `false` to disable this behavior, doing so is discouraged. ===== name: hudson.util.Secret.provider `escape hatch` def: system default \*Since\*: 1.360 \*Description\*:: Force a particular crypto provider; with Glassfish Enterprise set value to `SunJCE` to workaround https://issues.jenkins.io/browse/JENKINS-6459[JENKINS-6459] and GLASSFISH-11862. ===== name: hudson.util.StreamTaskListener.AUTO\_FLUSH `escape hatch` // https://github.com/jenkinsci/jenkins/pull/3961 \*Default\*: `false` \*Since\*: 2.173 \*Description\*:: Jenkins no longer automatically flushes streams for code running remotely on agents for better performance. This may lead to loss of messages for plugins which print to a build log from the agent machine but do not flush their output. Use this flag to restore the previous behavior for freestyle builds. ===== name: hudson.Util.symlinkEscapeHatch `escape hatch` \*Default\*: `false` \*Description\*:: True to use exec of "ln" binary to create symbolic links instead of native code ===== name: hudson.Util.useNativeChmodAndMode `escape hatch` \*Default\*: `false` \*Since\*: 2.93 \*Description\*:: True to use native (JNA/JNR) implementation to set file permissions instead of NIO. Removed without replacement in 2.304. ===== name: hudson.util.XStream2.collectionUpdateLimit `security` `tuning` `escape hatch` \*Default\*: `5` \*Since\*: 2.334 and 2.319.3 \*Description\*:: The maximum number of seconds that adding elements to collections may cumulatively take when loading an XML document using XStream, or `-1` to disable. See link:https://www.jenkins.io/security/advisory/2022-02-09///SECURITY-2602[2022-02-09 security advisory] for context. ===== name: hudson.WebAppMain.forceSessionTrackingByCookie `escape hatch` `security` \*Default\*: `true` \*Since\*: 2.234 \*Description\*:: Set to `false` to not force session tracking to be done via cookie. Escape hatch for https://issues.jenkins.io/browse/JENKINS-61738[JENKINS-61738]. ===== name: hudson.widgets.HistoryWidget.threshold `tuning` \*Default\*: `30` \*Since\*: 1.433 \*Description\*:: How many builds to show in the build history side panel widget. ===== name: historyWidget.descriptionLimit `feature` `UI` \*Default\*: `100` \*Since\*: 2.223 \*Description\*:: Defines a limit for the characters shown in the description field for each build row in the Build History column. A positive integer (e.g. `300`) will define the limit. After the limit is reached (...) will be shown. The value `-1` disables the limit and allows unlimited characters in the build description. The value `0` shows no description. ===== name: HUDSON\_HOME def: n/a `obsolete` \*Description\*:: Backward compatible fallback name for `JENKINS\_HOME`. See documentation there. ===== name: jenkins.CLI.disabled `feature` `obsolete` \*Default\*: `false` \*Since\*: 2.32 and 2.19.3 \*Description\*:: `true` to disable Jenkins CLI via JNLP and HTTP (SSHD can still be enabled). This has no effect since 2.165. ===== name: jenkins.InitReactorRunner.concurrency `tuning` def: 2x of CPU \*Description\*:: During the start of Jenkins, the loading of jobs in parallel have a fixed number of threads by default (twice the CPU). To make Jenkins load time 8x faster (assuming sufficient IO), increase it to 8x. For example, 24 CPU Jenkins controller host use this: `-Djenkins.InitReactorRunner.concurrency=192` ===== name: jenkins.install.runSetupWizard `feature` \*Default\*: undefined \*Since\*: 2.0 \*Description\*:: Set to `false` to skip install wizard. Note that doing so leaves Jenkins unsecured. Development-mode only: Set to `true` to not skip showing the setup wizard during Jenkins development. This property is only effective the first time you run Jenkins in given `JENKINS\_HOME`. ===== name: jenkins.install.SetupWizard.adminInitialApiToken `security` `packaging` def: The default admin account will not have an API Token unless a value is provided for this system property \*Since\*: "2.260" \*Description\*:: This property determines the behavior during the SetupWizard install phase concerning the API Token creation for the initial admin account. The behavior depends on the provided value: `true`:: A token is generated using random value at startup and the information is put | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.02722814306616783,
0.075584776699543,
-0.03483486548066139,
0.037251655012369156,
-0.030544403940439224,
-0.029028065502643585,
0.008980566635727882,
-0.06142069771885872,
0.026411548256874084,
-0.03707161173224449,
-0.034672390669584274,
-0.033018309623003006,
0.03454035893082619,
0.01... | -0.031915 |
provided for this system property \*Since\*: "2.260" \*Description\*:: This property determines the behavior during the SetupWizard install phase concerning the API Token creation for the initial admin account. The behavior depends on the provided value: `true`:: A token is generated using random value at startup and the information is put in the file `$JENKINS\_HOME/secrets/initialAdminApiToken`. "token" in plain text:: A fixed API Token will be created for the user with provided value as the token. "@[file-location]" which contains plain text value of the token:: A fixed API Token will be created for the user with the value read from the file. Jenkins will not delete the file after read, so the script is responsible to remove it when no longer needed. Token format is `[2-char hash version][32-hex-char of secret]`, where the hash version is currently only 11, e.g., `110123456789abcdef0123456789abcdef`. For example can be generated in following ways: \* manually by prepending `11` to output of random generator website. Ask for 32 hex digits or 16 bytes in hex, e.g. https://www.browserling.com/tools/random-hex, https://www.random.org/bytes/ \* in a shell: `echo "11$(openssl rand -hex 16)"` \* in JavaScript: `const genRanHex = size => [...Array(size)].map(() => Math.floor(Math.random() \* 16).toString(16)).join(''); console.log('11' + genRanHex(32));` When the API Token is generated using this system property, it should be revoked during the installation script using the other ways at your disposal so that you have a fresh (random) token with fewer traces for your script. See https://javadoc.jenkins.io/jenkins/security/ApiTokenProperty.html//generateNewToken-java.lang.String-[ApiTokenProperty//generateNewToken(String)] and https://javadoc.jenkins.io/jenkins/security/ApiTokenProperty.html//revokeAllTokensExceptOne-java.lang.String-[ApiTokenProperty//revokeAllTokensExceptOne(String)] for scripting methods or using the web API calls: `/user/[user-login]/descriptorByName/jenkins.security.ApiTokenProperty/generateNewToken` and `/user/[user-login]/descriptorByName/jenkins.security.ApiTokenProperty/revokeAllExcept` ===== name: jenkins.model.Jenkins.additionalReadablePaths `security` `escape hatch` \*Default\*: undefined \*Since\*: 2.263.2 / 2.275 \*Description\*:: A comma-separated list of additional top level path segments that should be accessible to users without Overall/Read permission. See link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-2047[2021-01-13 security advisory]. [#jenkins-model-jenkins-buildsdir] ===== name: jenkins.model.Jenkins.buildsDir `feature` \*Default\*: `${ITEM\_ROOTDIR}/builds` \*Since\*: 2.119 \*Description\*:: The configuration of a given job is located under `$JENKINS\_HOME/jobs/[JOB\_NAME]/config.xml` and its builds are under `$JENKINS\_HOME/jobs/[JOB\_NAME]/builds` by default. This option allows you to store builds elsewhere, which can be useful with finer-grained backup policies, or to store the build data on a faster disk such as an SSD. The following placeholders are supported for this value: \* `${JENKINS\_HOME}` – Resolves to the Jenkins home directory. \* `${ITEM\_ROOTDIR}` – The directory containing the job metadata within Jenkins home. \* `${ITEM\_FULL\_NAME}` – The full name of the item, with file system unsafe characters replaced by others. \* `${ITEM\_FULLNAME}` – See above, but does not replace unsafe characters. This is a legacy option and should not be used. For instance, if you would like to store builds outside of Jenkins home, you can use a value like the following: `/some\_other\_root/builds/${ITEM\_FULL\_NAME}` This used to be a UI setting, but was removed in 2.119 as it did not support migration of existing build records and could lead to build-related errors until restart. To manually migrate existing build records when starting to use this option (`TARGET\_DIR` is the value supplied to `jenkins.model.Jenkins.buildsDir`): For xref:pipeline:index.adoc[Pipeline] and Freestyle job types, run this for each `JOB\_NAME`: ```sh mkdir -p [TARGET\_DIR] mv $JENKINS\_HOME/jobs/[JOB\_NAME]/builds [TARGET\_DIR]/[JOB\_NAME] ``` For xref:pipeline:multibranch.adoc#creating-a-multibranch-pipeline[Multibranch Pipeline] jobs, run for each `BRANCH\_NAME`: ```sh mkdir -p [TARGET\_DIR]/[JOB\_NAME]/branches/ mv $JENKINS\_HOME/jobs/[JOB\_NAME]/branches/[BRANCH\_NAME]/builds \ [TARGET\_DIR]/[JOB\_NAME]/branches/[BRANCH\_NAME] ``` For xref:pipeline:multibranch.adoc#organization-folders[Organization Folders], run this for each `REPO\_NAME` and `BRANCH\_NAME`: ```sh mkdir -p [TARGET\_DIR]/[ORG\_NAME]/jobs/[REPO\_NAME]/branches/ mv $JENKINS\_HOME/jobs/[ORG\_NAME]/jobs/[REPO\_NAME]/branches/[BRANCH\_NAME]/builds \ [TARGET\_DIR]/[ORG\_NAME]/jobs/[REPO\_NAME]/branches/[BRANCH\_NAME] ``` ===== name: jenkins.model.Jenkins.crumbIssuerProxyCompatibility `escape hatch` `feature` \*Default\*: `false` \*Since\*: 2.119 \*Description\*:: `true` to enable crumb proxy compatibility when running the Setup Wizard for the first time. ===== name: jenkins.model.Jenkins.disableExceptionOnNullInstance `escape hatch` \*Default\*: `false` \*Since\*: 2.4 \*only\*, replaced in 2.5+ by jenkins.model.Jenkins.enableExceptionOnNullInstance \*Description\*:: `true` to disable throwing an `IllegalStateException` when `Jenkins.getInstance()` returns `null` ===== name: jenkins.model.Jenkins.enableExceptionOnNullInstance `escape hatch` \*Default\*: `false` \*Since\*: 2.5 \*Description\*:: `true` to | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.04783483222126961,
0.06572626531124115,
-0.003377223387360573,
0.007401932496577501,
-0.006448002532124519,
-0.06435515731573105,
0.05115276202559471,
0.03462320566177368,
0.07206864655017853,
0.010777726769447327,
0.005917718634009361,
0.02425873838365078,
0.07795850187540054,
-0.05841... | 0.083441 |
crumb proxy compatibility when running the Setup Wizard for the first time. ===== name: jenkins.model.Jenkins.disableExceptionOnNullInstance `escape hatch` \*Default\*: `false` \*Since\*: 2.4 \*only\*, replaced in 2.5+ by jenkins.model.Jenkins.enableExceptionOnNullInstance \*Description\*:: `true` to disable throwing an `IllegalStateException` when `Jenkins.getInstance()` returns `null` ===== name: jenkins.model.Jenkins.enableExceptionOnNullInstance `escape hatch` \*Default\*: `false` \*Since\*: 2.5 \*Description\*:: `true` to enable throwing an `IllegalStateException` when `Jenkins.getInstance()` returns `null` ===== name: jenkins.model.Jenkins.exitCodeOnRestart `packaging` \*Default\*: `5` \*Since\*: 2.102 \*Description\*:: When using the `-Dhudson.lifecycle=hudson.lifecycle.ExitLifecycle`, exit using this exit code when Jenkins is restarted ===== name: jenkins.model.Jenkins.initLogLevel \*Default\*: `FINE` \*Description\*:: Log level for verbose messages from the init reactor listener. ===== name: jenkins.model.Jenkins.killAfterLoad \*Default\*: `false` \*Description\*:: Exit Jenkins right after loading. Intended as a development/testing aid only. ===== name: jenkins.model.Jenkins.logStartupPerformance \*Default\*: `false` \*Description\*:: Log startup timing info. Note that some messages are not logged on levels visible by default (i.e. INFO and up). ===== name: jenkins.model.Jenkins.nameValidationRejectsTrailingDot `security` `escape hatch` \*Default\*: `true` \*Since\*: 2.315 and 2.303.2 \*Description\*:: Set to `false` to allow names to end with a trailing `.` character, which can cause problems on Windows. Escape hatch for link:https://www.jenkins.io/security/advisory/2021-10-06///SECURITY-2424[SECURITY-2424]. ===== name: jenkins.model.Jenkins.parallelLoad `escape hatch` \*Default\*: `true` \*Description\*:: Loads job configurations in parallel on startup. ===== name: jenkins.model.Jenkins.slaveAgentPort `feature` \*Default\*: `-1` (disabled) since 2.0, `0` in Jenkins 1.x. \*Since\*: 1.643 \*Description\*:: Specifies the default TCP agent port unless/until configured differently on the UI. `-1` to disable, `0` for random port, other values for fixed port. ===== name: jenkins.model.Jenkins.slaveAgentPortEnforce `feature` \*Default\*: `false` \*Since\*: 2.19.4 and 2.24 \*Description\*:: If true, enforces the specified `jenkins.model.Jenkins.slaveAgentPort` on startup and will not allow changing it through the UI ===== name: jenkins.model.Jenkins.workspaceDirName `obsolete` \*Default\*: `workspace` \*Description\*:: Obsolete: Was used as the default workspace directory name in the legacy workspace directory layout (workspace directories within job directories). ===== name: jenkins.model.Jenkins.workspacesDir `feature` \*Default\*: `${JENKINS\_HOME}/workspace/${ITEM\_FULL\_NAME}` \*Since\*: 2.119 \*Description\*:: Allows to change the directory layout for the job workspaces on the controller node. See `jenkins.model.Jenkins.buildsDir` for supported placeholders. ===== name: jenkins.model.JenkinsLocationConfiguration.disableUrlValidation `escape hatch` \*Default\*: `false` \*Since\*: 2.197 / LTS 2.176.4 \*Description\*:: Disable URL validation intended to prevent an XSS vulnerability. See link:https://www.jenkins.io/security/advisory/2019-09-25///SECURITY-1471[SECURITY-1471] for details. ===== name: jenkins.model.lazy.BuildReference.MODE `development` `tuning` \*Default\*: `soft` \*Since\*: 1.548 \*Description\*:: Configure the kind of reference Jenkins uses to hold builds in memory. Choose from among `soft`, `weak`, `strong`, and `not` (do not hold builds in memory at all). Intended mostly as a debugging aid. See https://issues.jenkins.io/browse/JENKINS-19400[JENKINS-19400]. ===== name: jenkins.model.Nodes.enforceNameRestrictions `security` `escape hatch` \*Default\*: `true` \*Since\*: 2.263.2 / 2.275 \*Description\*:: Whether to enforce new name restrictions for agent names. See link:https://www.jenkins.io/security/advisory/2021-01-13///SECURITY-2021[2021-01-13 security advisory]. ===== name: jenkins.model.StandardArtifactManager.disableTrafficCompression `tuning` `feature` \*Default\*: `false` \*Since\*: 2.196 \*Description\*:: `true` to disable GZIP compression of artifacts when they're transferred from agent nodes to controller. Uses less CPU at the cost of increased network traffic. ===== name: jenkins.monitor.JavaVersionRecommendationAdminMonitor.disable `feature` \*Default\*: `false` \*Since\*: 2.305 \*Description\*:: `true` to disable the monitor that recommends newer Java versions. ===== name: jenkins.security.ApiTokenProperty.adminCanGenerateNewTokens `escape hatch` `security` \*Default\*: `false` \*Since\*: 2.129 \*Description\*:: `true` to allow users with Overall/Administer permission to create API tokens using the new system for any user. Note that the user will not be able to use that token since it's only displayed to the creator, once. ===== name: jenkins.security.ApiTokenProperty.showTokenToAdmins `escape hatch` `security` \*Default\*: `false` \*Since\*: 1.638 \*Description\*:: True to show API tokens for users to administrators on the user configuration page. This was set to `false` as part of link:https://www.jenkins.io/security/advisory/2015-11-11///api-tokens-of-other-users-available-to-admins[SECURITY-200] ===== name: jenkins.security.ClassFilterImpl.SUPPRESS\_ALL `escape hatch` `security` \*Default\*: `false` \*Since\*: 2.102 \*Description\*:: Do not perform any JEP-200 class filtering when deserializing data. Setting this to `true` is unsafe. See link:https://www.jenkins.io/redirect/class-filter/[documentation]. ===== name: jenkins.security.ClassFilterImpl.SUPPRESS\_WHITELIST `escape hatch` `security` \*Default\*: `false` \*Since\*: 2.102 \*Description\*:: Do not perform whitelist-based JEP-200 class filtering when deserializing data. With this | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.02236779034137726,
-0.021101059392094612,
0.08222639560699463,
-0.02014991268515587,
-0.03113166056573391,
-0.055943332612514496,
-0.09756910055875778,
-0.03897092118859291,
-0.024072997272014618,
-0.005107203032821417,
0.03278551623225212,
-0.01645011268556118,
-0.004381628707051277,
0... | -0.028573 |
jenkins.security.ClassFilterImpl.SUPPRESS\_ALL `escape hatch` `security` \*Default\*: `false` \*Since\*: 2.102 \*Description\*:: Do not perform any JEP-200 class filtering when deserializing data. Setting this to `true` is unsafe. See link:https://www.jenkins.io/redirect/class-filter/[documentation]. ===== name: jenkins.security.ClassFilterImpl.SUPPRESS\_WHITELIST `escape hatch` `security` \*Default\*: `false` \*Since\*: 2.102 \*Description\*:: Do not perform whitelist-based JEP-200 class filtering when deserializing data. With this flag set, only explicitly blacklisted types will be rejected. Setting this to `true` is unsafe. See link:https://www.jenkins.io/redirect/class-filter/[documentation]. ===== name: jenkins.security.FIPS140.COMPLIANCE `feature` `security` \*Default\*: `false` \*Since\*: 2.424 \*Description\*:: If Jenkins and plugins systems should prefer link:https://csrc.nist.gov/pubs/fips/140-2/upd2/final[FIPS-140] compliant cryptography. Not all features/plugins have been adapted, and this only indicates a preference. If you set this flag to `true`, it does not make Jenkins and its plugins FIPS-140 compliant. Refer to xref:dev-docs:FIPS-140:index.adoc[Jenkins and FIPS-140 Overview] for more information. ===== name: jenkins.security.FrameOptionsPageDecorator.enabled `escape hatch` `security` \*Default\*: `true` \*Since\*: 1.581 \*Description\*:: Whether to send `X-Frame-Options: sameorigin` header, set to `false` to disable and make Jenkins embeddable ===== name: jenkins.security.ignoreBasicAuth // TODO test whether this actually works `feature` `security` \*Default\*: `false` \*Since\*: 1.421 \*Description\*:: When set to `true`, disable `Basic` authentication with username and password (rather than API token). [#jenkins-security-managepermission] ===== name: jenkins.security.ManagePermission `feature` `security` \*Default\*: `false` \*Since\*: 2.222 \*Description\*:: Enable the optional Overall/Manage permission that allows limited access to administrative features suitable for a hosted Jenkins environment. See https://github.com/jenkinsci/jep/tree/master/jep/223[JEP-223]. ===== name: jenkins.security.ResourceDomainRootAction.validForMinutes `tuning` `security` \*Default\*: `30` \*Since\*: 2.200 \*Description\*:: How long a resource URL served from the resource root URL will be valid for before users are required to reauthenticate to access it. See inline documentation in Jenkins for details. ===== name: jenkins.security.s2m.CallableDirectionChecker.allow `security` `escape hatch` \*Default\*: `false` \*Since\*: 1.587 and 1.580.1 \*Description\*:: This flag can be set to `true` to disable the agent-to-controller security system entirely. Since Jenkins 2.326, this is the only way to do that, as the UI option has been removed. ===== name: jenkins.security.s2m.CallableDirectionChecker.allowAnyRole `security` `obsolete` \*Default\*: `true` \*Since\*: 2.319 and 2.303.3 \*Description\*:: This flag can be set to `false` to explicitly reject `Callable` implementations that do not declare any required role. It is unclear whether this can safely be set to `false` in Jenkins before 2.335, or whether that would cause problems with some remoting built-in callables. This flag was removed in Jenkins 2.335. ===== name: jenkins.security.s2m.DefaultFilePathFilter.allow `escape hatch` `security` \*Default\*: `false` \*Since\*: 1.587 and 1.580.1 \*Description\*:: Allow all file paths on the Jenkins controller to be accessed from agents. This disables a big part of link:https://www.jenkins.io/security/advisory/2014-10-30/[SECURITY-144] protections. ===== name: jenkins.security.s2m.RunningBuildFilePathFilter.FAIL `escape hatch` `security` \*Default\*: `true` \*Since\*: 2.319 and 2.303.3 \*Description\*:: Set to `false` to not reject attempts to access file paths in build directories of builds not currently being built on the accessing agent. Instead, only a warning is logged. Attempts to access file paths in build directories from other processes will still fail. See link:https://www.jenkins.io/security/advisory/2021-11-04///SECURITY-2455[the description of the SECURITY-2458 security fix] for context. ===== name: jenkins.security.s2m.RunningBuildFilePathFilter.SKIP `escape hatch` `security` \*Default\*: `false` \*Since\*: 2.319 and 2.303.3 \*Description\*:: Set to `true` to disable the additional protection to not reject attempts to access file paths in build directories. This will restore access to any build directories both from agents and from other processes with a remoting channel, like Maven Integration Plugin. See link:https://www.jenkins.io/security/advisory/2021-11-04///SECURITY-2455[the description of the SECURITY-2458 security fix] for context. ===== name: jenkins.security.seed.UserSeedProperty.disableUserSeed `escape hatch` `security` \*Default\*: `false` \*Since\*: 2.160 and 2.105.2 \*Description\*:: Disables \_user seed\_. Escape hatch for link:https://www.jenkins.io/security/advisory/2019-01-16///SECURITY-901[SECURITY-901]. ===== name: jenkins.security.seed.UserSeedProperty.hideUserSeedSection `ui` `security` \*Default\*: `false` \*Since\*: 2.160 and 2.105.2 \*Description\*:: Hide the UI for \_user seed\_ introduced for link:https://www.jenkins.io/security/advisory/2019-01-16///SECURITY-901[SECURITY-901]. ===== name: jenkins.security.stapler.StaplerDispatchValidator.disabled `escape hatch` `security` \*Default\*: `false` \*Since\*: 2.186 and 2.176.2 \*Description\*:: Escape hatch for link:https://www.jenkins.io/security/advisory/2019-07-17///SECURITY-534[SECURITY-534]. ===== name: jenkins.security.stapler.StaplerDispatchValidator.whitelist `escape hatch` `security` \*Default\*: `stapler-views-whitelist.txt` in `JENKINS\_HOME` \*Since\*: 2.186 | https://github.com/jenkins-infra/docs.jenkins.io/blob/main//docs/user-docs/modules/managing/pages/system-properties.adoc | main | jenkins | [
-0.04834151640534401,
0.1381070911884308,
0.02510427124798298,
-0.005696386564522982,
0.026676956564188004,
-0.02769622579216957,
0.02692730911076069,
-0.07047285884618759,
-0.02133970893919468,
-0.024844717234373093,
-0.013673847541213036,
-0.04329465702176094,
-0.007765151094645262,
0.02... | 0.090758 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.