Jenkins

Jenkins Reload Configuration From Disk

The Reload Configuration from Disk command in Jenkins allows you to refresh Jenkins configuration files and directory structure.

This command is used when a change is made to Jenkins and its environment outside the UI, such as editing config.xml files from the command line or moving jobs between folders from the command line.

How to Reload Jenkins Configution From Disk

From the Jenkins web interface, head to the “Manage Jenkins” page and click on the “Reload Configuration from Disk” button.

This will reload the config.xml file from the disk and any changes made will take effect immediately.

You can also use the Jenkins CLI to reload the configuration from the disk. Run the command as shown:

java -jar jenkins-cli.jar -s http://jenkins_address reload-configuration

An example is as shown:

$ java -jar Jenkins-cli.jar -s https://localhost:8080 reload-configuration

Finally, we can use the REST API in Jenkins to reload the configuration from the disk as shown:

You can make a POST request to http://jenkins_address/reload to reload the Jenkins configuration.

Example:

curl -X POST http://localhost:9001/reload

This may require you to pass your Jenkins credentials for authentication.

Conclusion

We discussed the various methods to reload the Jenkins configuration from disk. The Jenkins web interface provides a user-friendly way of reloading the configuration by clicking on the “Reload Configuration from Disk” button on the “Manage Jenkins” page.

Additionally, we discussed how to use the Jenkins CLI and the Jenkins REST API to reload the configuration. It is important to note that reloading the configuration from the disk will interrupt all running builds and tasks, so it is best to schedule this action during inactive periods.

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list