Skip to content

Commit

Permalink
Add support for MariaDB
Browse files Browse the repository at this point in the history
  • Loading branch information
Biptaste committed Apr 13, 2022
1 parent ae0b3ca commit ad44a79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions actions/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,23 @@ func makeDump(ctx domain.ExecutionContext, dbBackup domain.DatabaseBackupConfig,
if dbType == "" {
if strings.Contains(config.Image, "mysql") {
dbType = "mysql"
} else if strings.Contains(config.Image, "mariadb") {
dbType = "mariadb"
} else if strings.Contains(config.Image, "postgres") {
dbType = "postgres"
} else if strings.Contains(config.Image, "mongo") {
dbType = "mongo"
}
}

if dbType == "mysql" {
if dbType == "mysql" || dbType == "mariadb" {
return mysqlDump(containerID, config.Env, backupDir, dbBackup.Databases)
} else if dbType == "postgres" {
return postgresDump(containerID, config.Env, backupDir, dbBackup.Databases)
} else if dbType == "mongo" {
return mongoDump(path.Join(backupDir, "mongodb.archive"), containerID, config.Env, backupDir)
} else {
return fmt.Errorf("\nError: unsupported database (only MySQL, PostgreSQL or MongoDB)")
return fmt.Errorf("\nError: unsupported database (only MySQL, MariaDB, PostgreSQL or MongoDB)")
}
}

Expand Down
2 changes: 1 addition & 1 deletion pliz.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ backup:
# supported DB: MySQL or MongoDB
databases:
- container: db
type: mysql # mysql|mongo, optional. If not present, the image name is used to try to guess the type
type: mysql # mysql|mariadb|postgres|mongo, optional. If not present, the image name is used to try to guess the type
databases: # only used for mysql. List of databases to backup
- db
- ghost

0 comments on commit ad44a79

Please sign in to comment.