26

I installed Jenkins on Ubuntu 10.10 and I could not find any mention of setting up database for data persistance.

So the first question is where does the data get stored, and secondly, can we setup Hudson / Jenkins with mySQL ? or similar databases?

kamal
  • 529

5 Answers5

15

Hudson/Jenkins doesn't quite work that way. It stores configurations and job information in /var/lib/jenkins by default (if you're using the .deb package). If you want to setup persistence for a specific application, that's something you'll want to handle yourself - Hudson is a continuous integration server, not a test framework.

Check out the Wiki article on Continuous Integration for an overview of what to expect.

HopelessN00b
  • 54,273
Andrew M.
  • 11,412
7

Jenkins can seem like it is storing data, based on what your scripts are doing and how.

As an example; the scripts that run your daily commit builds can be setup to hand off the "pass/fail" results to Jenkins to store in an XML file. Then, if you are ever interested in pulling up the historical "pass/fail" results and using them somewhere other than in the Jenkins GUI, you can make a call into the Jenkins API and get a return of that XML. Parse it and you've got the data you need.

But -- Other than doing this, Jenkins has no repository system all by its lonesome.

In addition, following is the jenkins api information: https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API

Reddy
  • 103
Jag
  • 71
2

The answer is that jenkins will not set this up for you. You need to tell it how to setup the environment and how to execute it's tests. This is normally done in the build steps section. If you will provide more info as to which platform you are using them perhaps we could give you a more concrete answer. You could have a shell script that will install your application and run it's tests, and then you call that from hudson. Making the test runner output data in a hudson-friendly way to finally get the results of your tests into the webUI for viewing those.

Jorge Vargas
  • 189
  • 2
2

It stores data in your home directory in a .jenkins directory. You can find all relevant information related to your builds in this directory.

Jenkins not provides build in support for connecting to any database.

HBruijn
  • 84,206
  • 24
  • 145
  • 224
1

Jenkins stores its config and history in files vs a database, and it doesn't really scale well on its own.

Job Configurations: Jenkins stores the configuration for each job in an XML file named config.xml, located in the job's directory. This file contains all the settings and definitions of the job, including triggers, SCM settings, and build steps.

Build History: Each build of a job is stored in a separate directory within the job’s directory. For example, for a job named MyJob, Jenkins creates a directory structure like JENKINS_HOME/jobs/MyJob/builds/, where each build gets its own subdirectory (e.g., #1, #2, etc.). These directories contain the metadata for each build, such as the build result, timestamps, and console output.

Console Output: The console output of a build is stored in a log file inside the build’s directory. This file contains the textual output that you see in the Jenkins web interface when you view the console log of a build. Archived Artifacts: If a job is configured to archive artifacts (e.g., build outputs like JAR files), these files are stored in a directory named archive inside the build’s directory.

Jenkins doesn’t use a database by default for storing job history or logs; everything is file-based. However, plugins can be added to store build results in a database for better reporting and analytics (e.g., the Monitoring or Analytics plugins).

Credentials: Jenkins stores credentials securely using a credentials.xml file located in the Jenkins home directory (JENKINS_HOME). This file is encrypted for security.

Plugins and Global Configuration: The global settings for Jenkins, including security settings, plugin configurations, and global environment variables, are stored in config.xml in the JENKINS_HOME directory.

Kevin M
  • 11
  • 2