In version 3.x, the output of mongodump is on stderr, but on 2.6.x
it writes information to stdout. This change doesn't break 3.x in
my tests but prevents extraneous junk in beginning of the tar file
when exporting in 2.6.x.
Updated test to match redirect in exec command.
The -o= seems to work fine in 3.x but in 2.x it actually includes the equals sign in the path, resulting in "/=/tmp/tmp.XXXXXX". The mongodump command docs for neither 2.x nor 3.x list the equals sign as part of the -o or --out parameter. It seems to work fine in 3.x with or without the equals sign.
Updated test to reflect change to -o
Previously we were exporting `MONGO_URL` via the docker-args* hooks.
This seems to confuse our users (since the env var is not displayed
when calling `dokku config`) and in some cases it also seems that the
env var is not correctly set.
Another problem is if several services are linked to the same app and
if they are exporting `MONGO_URL` as well. Then we don’t know what
will be set.
To resolve theses issues, this patch changes the way we manage the env
vars. We use standard dokku commands (`config` and `docker-options`) so
config is set on the linked application and can be reviewed by the user
easily.
We also handle the case where `MONGO_URL` is already set on the
linked application. When it’s the case, we automatically generate
another env var based on the following pattern: DOKKU_<service
name>_<random unused color>_URL. For example, this can give:
DOKKU_MONGO_BLACK_URL.
Since naming is now handled automatically, the `alias` command has been
removed. If the user wants to set a different env var on her app, it’s
just a matter of using `dokku config:set` and pasting the wanted value.
IP in DSN has been removed in favor of host name exported by docker in
the container. This is more robust and simpler since the IP can change
but the name will remain the same if the service container restarts for
instance.
With all those changes, a new command has been introduced: `promote`.
The goal of this command is to easily set a service as the primary one
when several are linked to an app. (see README for an example)