woodpecker/docs/docs/30-administration/30-database.md
Anbraten 9267a46d5c
[Docs] Migrate docs framework to Docusaurus (#282)
- Replace mkdocs with docosaurus (improved menu structure, ...)
- Structure docs into `Usage` and `Server Setup / Administration`
- Update favicon
- Create new pipeline-syntax page with all options and links to more detailed docs if available
- Add ci to publish to `woodpecker-ci.github.io`
- Deploy docs preview to surge for review
- Update start-page

Co-authored-by: 6543 <6543@obermui.de>
2021-09-11 17:10:32 +02:00

2.1 KiB

Databases

This guide provides instructions for using alternate storage engines. Please note this is optional. The default storage engine is an embedded SQLite database which requires zero installation or configuration.

Configure MySQL

The below example demonstrates mysql database configuration. See the official driver documentation for configuration options and examples.

version: '3'

services:
  woodpecker-server:
    image: woodpeckerci/woodpecker-server:latest
    environment:
+     WOODPECKER_DATABASE_DRIVER: mysql
+     WOODPECKER_DATABASE_DATASOURCE: root:password@tcp(1.2.3.4:3306)/woodpecker?parseTime=true

Configure Postgres

The below example demonstrates postgres database configuration. See the official driver documentation for configuration options and examples.

version: '3'

services:
  woodpecker-server:
    image: woodpeckerci/woodpecker-server:latest
    environment:
+     WOODPECKER_DATABASE_DRIVER: postgres
+     WOODPECKER_DATABASE_DATASOURCE: postgres://root:password@1.2.3.4:5432/postgres?sslmode=disable

Database Creation

Woodpecker does not create your database automatically. If you are using the mysql or postgres driver you will need to manually create your database using CREATE DATABASE

Database Migration

Woodpecker automatically handles database migration, including the initial creation of tables and indexes. New versions of Woodpecker will automatically upgrade the database unless otherwise specified in the release notes.

Database Backups

Woodpecker does not perform database backups. This should be handled by separate third party tools provided by your database vendor of choice.

Database Archiving

Woodpecker does not perform data archival; it considered out-of-scope for the project. Woodpecker is rather conservative with the amount of data it stores, however, you should expect the database logs to grow the size of your database considerably.