feat: ship every datastore as a core datastore plugin

Adds a `datastore` core plugin that serves every official datastore under one command, with the datastore type as the first argument, as in `dokku datastore:create postgres lollipop`. It is built on the dokku-datastore sdk, and leaves a datastore to its official plugin while that plugin is enabled.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-10-29 20:32:20 -04:00
1 parent 029de94cc6
commit 68e5757590
17 files changed
+688

No files matched your search

@@ -0,0 +1,14 @@
package main
import (
"os"
"github.com/dokku/dokku-datastore/sdk"
)
// main answers the help dokku asks every plugin for, and runs any datastore
// command dokku found no subcommand for, which is what a datastore's own
// commands are
func main() {
os.Exit(sdk.RunCommands(os.Args[1:]))
}
@@ -0,0 +1,21 @@
package main
import (
"os"
"strings"
"github.com/dokku/dokku-datastore/sdk"
)
// main entrypoint to all subcommands
func main() {
parts := strings.Split(os.Args[0], "/")
subcommand := parts[len(parts)-1]
args := []string{}
if len(os.Args) > 2 {
args = os.Args[2:]
}
os.Exit(sdk.RunSubcommand(subcommand, args))
}
@@ -0,0 +1,16 @@
package main
import (
"os"
"strings"
"github.com/dokku/dokku-datastore/sdk"
)
// main entrypoint to all triggers
func main() {
parts := strings.Split(os.Args[0], "/")
trigger := parts[len(parts)-1]
os.Exit(sdk.RunTrigger(trigger, os.Args[1:]))
}