using gzip as standard for backup and restore. upgrading mongo version.

This commit is contained in:
Joseph Cutrono
2017-10-23 00:13:04 -04:00
parent bfa7e0d31e
commit 75571ad7f2
7 changed files with 11 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ case "$1" in
echo "dokkupaas/docker-grafana-graphite 3.0.1 75dcd48a5eef 2 days ago 936.4 MB"
echo "mariadb 10.1.16 f2485761e714 2 days ago 302.2 MB"
echo "memcached 1.4.31 8a05b51f8876 2 days ago 132.4 MB"
echo "mongo 3.2.9 12eadb136159 2 days ago 291.1 MB"
echo "mongo 3.4.9 12eadb136159 2 days ago 291.1 MB"
echo "mysql 5.7.12 57d56ac47bed 2 days ago 321.3 MB"
echo "nats 0.9.4 9216d5a4eec8 2 days ago 109.3 MB"
echo "postgres 9.5.4 6412eb70175e 2 days ago 265.7 MB"

View File

@@ -27,7 +27,7 @@ teardown() {
run dokku "$PLUGIN_COMMAND_PREFIX:export" l
password="$(cat "$PLUGIN_DATA_ROOT/l/PASSWORD")"
assert_exit_status 0
assert_output "docker exec dokku.mongo.l bash -c DIR=\$(mktemp -d) && mongodump -d l -o \"\$DIR\" -u \"l\" -p \"$password\" --authenticationDatabase \"l\" 1>&2 && tar cf - -C \"\$DIR\" . && rm -rf \"\$DIR\""
assert_output "docker exec dokku.mongo.l bash -c mongodump -d l -u \"l\" -p \"$password\" --authenticationDatabase \"l\" --gzip --archive 2>/dev/null"
}
@test "($PLUGIN_COMMAND_PREFIX:export) success without SSH_TTY" {
@@ -36,5 +36,5 @@ teardown() {
run dokku "$PLUGIN_COMMAND_PREFIX:export" l
password="$(cat "$PLUGIN_DATA_ROOT/l/PASSWORD")"
assert_exit_status 0
assert_output "docker exec dokku.mongo.l bash -c DIR=\$(mktemp -d) && mongodump -d l -o \"\$DIR\" -u \"l\" -p \"$password\" --authenticationDatabase \"l\" 1>&2 && tar cf - -C \"\$DIR\" . && rm -rf \"\$DIR\""
assert_output "docker exec dokku.mongo.l bash -c mongodump -d l -u \"l\" -p \"$password\" --authenticationDatabase \"l\" --gzip --archive 2>/dev/null"
}

View File

@@ -32,6 +32,6 @@ teardown() {
export ECHO_DOCKER_COMMAND="true"
run dokku "$PLUGIN_COMMAND_PREFIX:import" l < "$PLUGIN_DATA_ROOT/fake.dump.tar"
password="$(cat "$PLUGIN_DATA_ROOT/l/PASSWORD")"
assert_output "docker exec -i dokku.mongo.l bash -c DIR=\$(mktemp -d) && tar xf - -C \"\$DIR\" && mongorestore -d l -u \"l\" -p \"$password\" --authenticationDatabase \"l\" \$(find \"\$DIR\" -mindepth 1 -maxdepth 1 -type d | head -n1) && rm -rf \"\$DIR\""
assert_output "docker exec -i dokku.mongo.l bash -c mongorestore -u \"l\" -p \"$password\" --authenticationDatabase \"l\" --gzip --archive --nsFrom '\$db\$.\$coll\$' --nsTo 'l.\$coll\$'"
}

View File

@@ -11,20 +11,20 @@ teardown() {
@test "($PLUGIN_COMMAND_PREFIX:list) with no exposed ports, no linked apps" {
run dokku "$PLUGIN_COMMAND_PREFIX:list"
assert_contains "${lines[*]}" "l mongo:3.2.9 running - -"
assert_contains "${lines[*]}" "l mongo:3.4.9 running - -"
}
@test "($PLUGIN_COMMAND_PREFIX:list) with exposed ports" {
dokku "$PLUGIN_COMMAND_PREFIX:expose" l 4242 4243 4244 4245
run dokku "$PLUGIN_COMMAND_PREFIX:list"
assert_contains "${lines[*]}" "l mongo:3.2.9 running 27017->4242 27018->4243 27019->4244 28017->4245 -"
assert_contains "${lines[*]}" "l mongo:3.4.9 running 27017->4242 27018->4243 27019->4244 28017->4245 -"
}
@test "($PLUGIN_COMMAND_PREFIX:list) with linked app" {
dokku apps:create my_app
dokku "$PLUGIN_COMMAND_PREFIX:link" l my_app
run dokku "$PLUGIN_COMMAND_PREFIX:list"
assert_contains "${lines[*]}" "l mongo:3.2.9 running - my_app"
assert_contains "${lines[*]}" "l mongo:3.4.9 running - my_app"
dokku --force apps:destroy my_app
}