GoCD Database Connection Properties
A properties file with the name needs to be created in the GoCD’s configuration directory (config/
). The location of GoCD’s configuration directory varies per operating system. Refer Location of GoCD server files to know the location of GoCD Server config directory.
The valid keys in the configuration file are mentioned below:
The feature of GoCD backs up both the configuration and database. Depending upon the type of the database, additional arguments can be specified, which will be used by underlying utility by GoCD while backing up the database.
GoCD uses pg_dump utility for backing up a PostgreSQL database. Refer to know all available PostgreSQL database backup options.
Example:
Specify db.extraBackupCommandArgs=--format=plain
property to specify --format=plain
option to the pg_dump
backup utility, which causes it to take a plain text backup.
Example:
Specify db.extraBackupCommandArgs=--compact
property to specify --compact
option to the mysqldump
backup utility, which causes it to produce more compact output.
The One Click Backup feature of GoCD backs up both the configuration and database. Depending upon the type of the database, additional environment variables can be specified, which will be used by underlying utility by GoCD while backing up the database.
See and MySQL Environment Variables to know the set of environment variables used by and mysqldump utility respectively.
Example:
Specify db.extraBackupEnv.PGCLIENTENCODING=UTF8
property to specify PGCLIENTENCODING
environment variable with value UTF8
.
Specify db.connectionProperties
to encrypt the communication between the GoCD Server applications and your database instance. Depending on the type of the database server, different connection properties could be specified for your SSL configuration.
To configure SSL for the PostgreSQL database:
take a look at the documentation.
see libpq connection parameters to see all the available options.
Below is an example of PostgreSQL SSL connection properties:
2. MySQL SSL Configuration:
Refer MySQL Command Options for Encrypted Connections documentation to know about all the available options for that are specified to use encrypted connections with the server.
db.connectionProperties.ssl-cert=/var/lib/go-server/client-cert.pem
db.connectionProperties.ssl-key=/var/lib/go-server/client-key.pem
db.connectionProperties.ssl-ca=/var/lib/go-server/ca.pem