Problem
`dbdeployer init` is hardcoded to download and install a MySQL tarball. There is no way to initialize a PostgreSQL environment, even though dbdeployer v2.x supports PostgreSQL as a first-class provider for `deploy single`, `deploy replication`, etc.
Current behavior
```
$ dbdeployer init --help
Initializes dbdeployer environment:
- creates $SANDBOX_HOME and $SANDBOX_BINARY directories
- downloads and expands the latest MySQL tarball <-- no choice of provider
- installs shell completion file
Flags:
--dry-run Show operations but don't run them
--skip-all-downloads Do not download any file
--skip-shell-completion Do not download shell completion file
--skip-tarball-download Do not download MySQL tarball
```
Code:
```go
// ops/init.go:198
tarball, err := downloads.FindOrGuessTarballByVersionFlavorOS(version, common.MySQLFlavor,
OS, arch, minimal, true, false)
```
The flavor is hardcoded to `common.MySQLFlavor`.
Expected behavior
```
$ dbdeployer init --provider=postgresql
... downloads and installs latest PostgreSQL
```
Proposed fix
- Add `--provider` flag to `dbdeployer init` (values: `mysql`, `postgresql`, default `mysql`).
- For `postgresql`, install PostgreSQL via the existing provider path (deb extraction on Linux, similar on macOS).
- Update help text: "downloads and installs the latest MySQL or PostgreSQL tarball".
- Add a CI test that exercises `dbdeployer init --provider=postgresql`.
Related
PostgreSQL provider was added in the v2.x rewrite (see PRs on master). `deploy single`, `deploy replication`, and `downloads` all support `--provider=postgresql`. `init` is the remaining hole.
Problem
`dbdeployer init` is hardcoded to download and install a MySQL tarball. There is no way to initialize a PostgreSQL environment, even though dbdeployer v2.x supports PostgreSQL as a first-class provider for `deploy single`, `deploy replication`, etc.
Current behavior
```
$ dbdeployer init --help
Initializes dbdeployer environment:
Flags:
--dry-run Show operations but don't run them
--skip-all-downloads Do not download any file
--skip-shell-completion Do not download shell completion file
--skip-tarball-download Do not download MySQL tarball
```
Code:
```go
// ops/init.go:198
tarball, err := downloads.FindOrGuessTarballByVersionFlavorOS(version, common.MySQLFlavor,
OS, arch, minimal, true, false)
```
The flavor is hardcoded to `common.MySQLFlavor`.
Expected behavior
```
$ dbdeployer init --provider=postgresql
... downloads and installs latest PostgreSQL
```
Proposed fix
Related
PostgreSQL provider was added in the v2.x rewrite (see PRs on master). `deploy single`, `deploy replication`, and `downloads` all support `--provider=postgresql`. `init` is the remaining hole.