Commit Graph

15 Commits

Author SHA1 Message Date
Peter West
ab7cc8c1a1 Use config_get from config functions 2016-03-04 12:37:02 +00:00
Peter West
b7b25c91a0 Read DATABASE_ADAPTER variable from app when setting DATABASE_URL 2016-03-04 12:37:02 +00:00
Loïc Guitaut
318c3afb03 Display infos from list command in columns
Also add a LINKS column to easily view which services are linked to
which apps
2015-10-13 10:29:39 +02:00
Loïc Guitaut
13329f3e42 Revamp link/unlink commands
Previously we were exporting `DATABASE_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 `DATABASE_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 `DATABASE_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_MYSQL_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)
2015-09-30 23:05:16 +02:00
Loïc Guitaut
21a5d29581 Display image & version in list 2015-09-16 17:45:25 +02:00
Jose Diaz-Gonzalez
1b16812012 Display which ports are exposed in list 2015-09-07 18:57:09 -04:00
Jose Diaz-Gonzalez
3481b5a95f make test 2015-09-06 22:55:50 -04:00
Jose Diaz-Gonzalez
26a1c3db6f Fix link name 2015-09-06 22:08:56 -04:00
Jose Diaz-Gonzalez
a9316bf1f8 Properly implement port expose/unexpose 2015-09-06 21:57:54 -04:00
Jose Diaz-Gonzalez
6557f711b0 Move alias, link, unlink and logs commands into functions 2015-08-29 03:19:35 -04:00
Jose Diaz-Gonzalez
a7543b5a31 Move service checks into commands file 2015-08-29 02:58:48 -04:00
Jose Diaz-Gonzalez
35c9ad5318 Move info and list commands into shared functions
Also add better output formatting for both commands
2015-08-29 02:53:16 -04:00
Jose Diaz-Gonzalez
83e1dac6d6 Remove service verification from service_url function
It is not necessary to do so in a function that is called from other places that already verify the name.
2015-08-29 02:49:41 -04:00
Jose Diaz-Gonzalez
3bc7404aac Use central config for env vars 2015-08-29 01:53:43 -04:00
Jose Diaz-Gonzalez
1fcd7dee4a initial commit 2015-08-23 18:56:11 -04:00