Skip to content

A Jenkins plugin that automatically set up MySQL test databases for Jenkins jobs, easy ;)

License

Notifications You must be signed in to change notification settings

jbox-web/job-database-manager-mysql

Repository files navigation

Jenkins Job Database Manager Plugin for MySQL

GitHub license GitHub release Build Status Code Climate Download

A Jenkins plugin that automatically set up MySQL test databases for Jenkins jobs, easy ;)

Installation

Install the ruby-runtime plugin in Jenkins then download the hpi file and install it within Jenkins interface.

Configuration

In the global Jenkins configuration, set up host and port of your MySQL server and enter credentials of the MySQL user that shall be used to create databases and grant permissions. Note that this user needs the GRANT OPTION which is not included in ALL PRIVILEGES.

Usage

Configure a database name in a job. The plugin ensures the database exists when the job is run. It grants all permissions for the database to a job specific user and publishes its credentials in the environment variables $MYSQL_USER and $MYSQL_PASSWORD. It also ensures that the database is dropped at the end of the job.

These environment variables will be injected in the build :

  • $MYSQL_DATABASE
  • $MYSQL_USER
  • $MYSQL_PASSWORD
  • $MYSQL_HOST
  • $MYSQL_PORT

Important Note

This plugin does not integrate with the new Declarative Pipeline functionality in Jenkins. You will need to use a Freestyle or Multi-configuration job type to make use of it.

See also

There is also a PostgreSQL variant of this plugin : jbox-web/job-database-manager-postgresql

Contributors

A big thank to them for their contribution!

Contribute

You can contribute to this plugin in many ways such as :

  • Helping with documentation
  • Contributing code (features or bugfixes)
  • Reporting a bug
  • Submitting translations