|
1 | | -# junit-postgresql |
| 1 | +# Junit SQL Storage Plugin |
2 | 2 |
|
3 | | -[](https://ci.jenkins.io/job/Plugins/job/junit-postgresql-plugin/job/master/) |
4 | | -[](https://github.com/jenkinsci/junit-postgresql-plugin/graphs/contributors) |
5 | | -[](https://plugins.jenkins.io/junit-postgresql) |
6 | | -[](https://github.com/jenkinsci/junit-postgresql-plugin/releases/latest) |
7 | | -[](https://plugins.jenkins.io/junit-postgresql) |
| 3 | +[](https://ci.jenkins.io/job/Plugins/job/junit-sql-storage-plugin/job/master/) |
| 4 | +[](https://github.com/jenkinsci/junit-sql-storage-plugin/graphs/contributors) |
| 5 | +[](https://plugins.jenkins.io/junit-sql-storage) |
| 6 | +[](https://github.com/jenkinsci/junit-sql-storage-plugin/releases/latest) |
| 7 | +[](https://plugins.jenkins.io/junit-sql-storage) |
8 | 8 |
|
9 | 9 | ## Introduction |
10 | 10 |
|
11 | | -TODO Describe what your plugin does here |
| 11 | +Implements the pluggable storage API for the [Junit plugin](https://plugins.jenkins.io/junit/). |
| 12 | + |
| 13 | +In common CI/CD use-cases a lot of the space is consumed by test reports. |
| 14 | +This data is stored within JENKINS_HOME, and the current storage format requires huge overheads when retrieving statistics and, especially trends. |
| 15 | +In order to display trends, each report has to be loaded and then processed in-memory. |
| 16 | + |
| 17 | +The main purpose of externalising Test Results is to optimize Jenkins logic by querying the desired data from specialized external storage. |
| 18 | + |
| 19 | +This plugin adds a SQL extension, any database should work although we're only currently testing against PostgreSQL. |
| 20 | + |
| 21 | +Tables will be automatically created. |
12 | 22 |
|
13 | 23 | ## Getting started |
14 | 24 |
|
15 | | -TODO Tell users how to configure your plugin here, include screenshots, pipeline examples and |
16 | | -configuration-as-code examples. |
| 25 | +Install your database vendor specific plugin, you can use the Jenkins plugin manager to search for it: |
| 26 | + |
| 27 | +`${JENKINS_URL}/pluginManager/available?filter=Database` |
| 28 | + |
| 29 | +e.g. you could install the [PostgreSQL Database](https://plugins.jenkins.io/database-postgresql/) plugin. |
| 30 | + |
| 31 | +### UI |
| 32 | + |
| 33 | +Manage Jenkins => Configure System => Junit |
| 34 | + |
| 35 | +In the dropdown select 'SQL Database' |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +Manage Jenkins => Configure System => Global Database |
| 40 | + |
| 41 | +Select the database implementation you want to use and click 'Test Connection' to verify Jenkins can connect |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +Click 'Save' |
| 46 | + |
| 47 | +### Configuration as code |
| 48 | + |
| 49 | +```yaml |
| 50 | +unclassified: |
| 51 | + globalDatabaseConfiguration: |
| 52 | + database: |
| 53 | + postgreSQL: |
| 54 | + database: "jenkins" |
| 55 | + hostname: "${DB_HOST_NAME}" |
| 56 | + password: "${DB_PASSWORD}" |
| 57 | + username: "${DB_USERNAME}" |
| 58 | + validationQuery: "SELECT 1" |
| 59 | + junitTestResultStorage: |
| 60 | + storage: "database" |
| 61 | +``` |
17 | 62 |
|
18 | 63 | ## Contributing |
19 | 64 |
|
|
0 commit comments