Implement postgres:import command
This commit is contained in:
12
commands
12
commands
@@ -117,9 +117,15 @@ case "$1" in
|
||||
$PLUGIN_COMMAND_PREFIX:import)
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify a name for the service"
|
||||
verify_service_name "$2"
|
||||
SERVICE="$2"
|
||||
SERVICE="$2"; SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
|
||||
SERVICE_NAME="$(get_service_name "$SERVICE")"
|
||||
DATABASE_NAME="$(get_database_name $SERVICE)"
|
||||
PASSWORD=$(cat "$SERVICE_ROOT/PASSWORD")
|
||||
|
||||
dokku_log_fail "Not yet implemented"
|
||||
if [[ -t 0 ]]; then
|
||||
dokku_log_fail "No data provided on stdin."
|
||||
fi
|
||||
docker exec -i "$SERVICE_NAME" env PGPASSWORD="$PASSWORD" pg_restore -h localhost -cO -d "$DATABASE_NAME" -U postgres -w
|
||||
;;
|
||||
|
||||
$PLUGIN_COMMAND_PREFIX:logs)
|
||||
@@ -196,7 +202,7 @@ case "$1" in
|
||||
$PLUGIN_COMMAND_PREFIX:link <name> <app>, Link the $PLUGIN_SERVICE service to the app
|
||||
$PLUGIN_COMMAND_PREFIX:unlink <name> <app>, Unlink the $PLUGIN_SERVICE service from the app
|
||||
$PLUGIN_COMMAND_PREFIX:export <name>, Export a dump of the $PLUGIN_SERVICE service database
|
||||
$PLUGIN_COMMAND_PREFIX:import <name> <file>, NOT IMPLEMENTED
|
||||
$PLUGIN_COMMAND_PREFIX:import <name> < <file>, Import a dump into the $PLUGIN_SERVICE service database
|
||||
$PLUGIN_COMMAND_PREFIX:connect <name>, Connect via psql to a $PLUGIN_SERVICE service
|
||||
$PLUGIN_COMMAND_PREFIX:logs <name> [-t], Print the most recent log(s) for this service
|
||||
$PLUGIN_COMMAND_PREFIX:restart <name>, Graceful shutdown and restart of the $PLUGIN_SERVICE service container
|
||||
|
||||
Reference in New Issue
Block a user