fork 0k-charms
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
722 B

  1. # -*- mode: shell-script -*-
  2. include pretty
  3. export DB_NAME="$SERVICE_NAME" ## general type of database (ie: postgres/mysql...)
  4. export DB_DATADIR=/var/lib/mongodb
  5. export DATA_DIR=$SERVICE_DATASTORE$DB_DATADIR
  6. is_db_locked() {
  7. is_volume_used "$DATASTORE/${SERVICE_NAME}"
  8. }
  9. _set_server_db_params() {
  10. server_docker_opts+=("-v" "${SERVICE_CONFIGSTORE}/etc/mongod.conf:/etc/mongod.conf"
  11. "--add-host" "${SERVICE_NAME}:127.0.0.1")
  12. }
  13. _set_db_params() {
  14. local docker_ip="$1" docker_network="$2"
  15. db_docker_opts+=("--network" "$docker_network")
  16. db_cmd_opts+=("--host" "$docker_ip")
  17. check_command="db.serverStatus().ok"
  18. }
  19. ddb () { dcmd mongo "$@"; }