Commit Graph

50 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
fdf0c89532 Move all commands into subcommand structure 2016-05-15 22:47:15 -04:00
Jose Diaz-Gonzalez
f36b408d9c Upgrade help output for dokku 0.5.x
Also completely drop support for help output on 0.3.x
2016-05-15 19:15:57 -04:00
Jose Diaz-Gonzalez
1600896956 Move setting of PLUGIN_BASE_PATH to config 2016-05-15 18:44:00 -04:00
Jose Diaz-Gonzalez
87c9914432 quote SERVICE_NAME value 2016-05-08 15:16:07 -04:00
Jose Diaz-Gonzalez
e1125599a6 ensure we don't expand PLUGIN_DATA_ROOT 2016-05-08 15:13:37 -04:00
Jose Diaz-Gonzalez
60d62842c7 quote docker pull call 2016-05-08 15:13:25 -04:00
Jose Diaz-Gonzalez
2d905a5fe9 fix read call 2016-05-08 15:13:18 -04:00
Jose Diaz-Gonzalez
5b61dfda57 Move command check before DOKKU_TRACE to reduce trace output 2016-05-04 13:59:33 -04:00
Jose Diaz-Gonzalez
817ebbd405 Rework how config vars are sourced
- ensure we source config/functions from the correct directory
- move config sourcing up before DOKKU_TRACE to reduce trace output
2016-05-04 13:57:49 -04:00
Jose Diaz-Gonzalez
eae373e679 create container if not exists on service:start 2016-05-04 00:52:11 -04:00
Trey Thomas
a096291fa0 Automatically pull image if it's not already downloaded 2016-04-18 16:45:37 -06:00
Edgars Beigarts
fdd135f620 Fix exit code for redis:export when SSH_TTY is not present 2016-02-24 09:35:22 +02:00
Dhruv Dang
0cbd4a8608 Pull the correct default redis.conf
Pulls the correct default `redis.conf`file based on the version supplied in the `REDIS_IMAGE_VERSION` environment variable
2016-01-25 00:22:55 -08:00
Dhruv Dang
91d7df92ca Support custom redis.conf files
Even though the `$SERVICE_ROOT/config` volume is mapped to the `/usr/local/etc/redis` folder in the container, any specified `redis.conf` file in `$SERVICE_ROOT/config` will not be used by the running `redis-server` process. This pull request solves that problem, by downloading the `redis-stable/redis.conf` file from the redis website to `$SERVICE_ROOT/config/redis.conf`, then runs the redis server process in the container as `redis-server /usr/local/etc/redis/redis.conf`.

Users of `dokku-redis` will be able to configure the `$SERVICE_ROOT/config/redis.conf` file to their liking, restart the redis container and then see their changed configuration in effect.

This references [this issue](https://github.com/dokku/dokku-redis/issues/30).
2016-01-24 00:56:17 -08:00
Jose Diaz-Gonzalez
bda3ad2c10 Remove invalid service directory during command runs
Refs dokku/dokku-mariadb#30
2016-01-17 21:07:55 -05:00
Jose Diaz-Gonzalez
e3b0228881 Add support for custom environment variables when starting a service container 2015-11-05 01:23:17 -05:00
Loïc Guitaut
06c30ea25e Fix export when using ssh -t 2015-10-19 11:43:32 +02:00
Loïc Guitaut
a2427837dc Fix the destroy command
Checking for container with its service name instead of ID.
Doing a chmod 777 on `/data` before removing data from the service.
2015-10-12 11:12:30 +02:00
Loïc Guitaut
baeea96731 Revamp link/unlink commands
Previously we were exporting `REDIS_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 `REDIS_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 `REDIS_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_REDIS_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-10-05 15:29:36 +02:00
Jose Diaz-Gonzalez
f0378e8c8f Add redis:help command 2015-09-27 17:19:24 -04:00
Loïc Guitaut
e7aed00674 Use our own image to wait for services 2015-09-24 11:52:08 +02:00
Loïc Guitaut
7ea002b2a6 Do not always allocate a tty on connect 2015-09-21 10:33:58 +02:00
Loïc Guitaut
38ac7c1b0f Fix compatibility with dokku 0.4+ 2015-09-17 00:01:34 +02:00
Loïc Guitaut
57e4b08158 Add export, import and clone commands 2015-09-13 23:43:04 +02:00
Loïc Guitaut
06ff9ec50f Compatibility with dokku 0.3.x & 0.4.x for help output 2015-09-11 23:35:41 +02:00
Jose Diaz-Gonzalez
fcf3e15ab2 Merge pull request #5 from dokku/lg-add-more-tests
Add more tests
2015-09-09 11:36:34 -04:00
Loïc Guitaut
2a9f715eed Use aanand/wait image to wait for service to be ready 2015-09-09 17:30:14 +02:00
Jose Diaz-Gonzalez
cb36b55e29 Merge pull request #2 from dokku/lg-remove-docker-kill
Remove call to `docker kill`
2015-09-09 11:26:22 -04:00
Loïc Guitaut
e76bb13edf Use redis-cli from docker image
Instead of installing dependencies on the host, directly use the binary
shipped with the redis docker image. This will also prevent possible
problems when API change for example.
2015-09-08 10:34:29 +02:00
Loïc Guitaut
2ecc9df262 Remove call to docker kill 2015-09-07 10:28:23 +02:00
Jose Diaz-Gonzalez
81280ea224 Fix lint 2015-09-06 22:48:56 -04:00
Jose Diaz-Gonzalez
89fbc799e2 run linting 2015-09-06 22:36:32 -04:00
Jose Diaz-Gonzalez
f72bf5402d Label running containers
This will avoid issues where `dokku cleanup` removes the stopped containers (it should not do so, and instead should allow them to stay in stopped mode).

Containers will be labeled as follows:

- service: dokku=service dokku.service=SERVICE_NAME
- ambassador: dokku=ambassador dokku.ambassador=SERVICE_NAME

To destroy the containers, simply run the `service:destroy` command.
2015-09-06 19:29:28 -04:00
Jose Diaz-Gonzalez
2289c5f3dc Allow docker kill command to fail 2015-09-06 19:27:04 -04:00
Jose Diaz-Gonzalez
b457a82256 Ensure container is running before attempting to delete files in the container 2015-09-06 19:26:50 -04:00
Jose Diaz-Gonzalez
18ad9bb441 Add sleep before removing container 2015-09-06 18:14:28 -04:00
Jose Diaz-Gonzalez
418c7bfc66 Add docker kill statement back 2015-09-06 18:10:08 -04:00
Jose Diaz-Gonzalez
a311957af3 Update docs on start/stop/restart commands 2015-09-06 18:08:24 -04:00
Loïc Guitaut
16fb91cf16 Enable working expose/unexpose commands
`expose` and `unexpose` commands are now fully functionnal using the
ambassador pattern. This has the advantage to be a 100% docker solution
and to not have to restart the service container. Multiple ports are
exposed when service specify them.

`start` and `stop` commands have been made more robust. When calling
`start` or `stop` on an already started (or stopped) service, an error
will be printed out instead of issuing failing commands.

Exposed services will still be exposed after a `restart`. Also the
service containers (and ambassador containers) will start automatically
when docker boot up.
2015-09-06 15:23:04 +02:00
Loïc Guitaut
b2051f86fa Use $PLUGIN_PATH instead of dirname 2015-09-03 00:43:07 +02:00
Jose Diaz-Gonzalez
ac50d9c37c first - broken - pass at start/stop commands and working expose/expose commands
note that at the moment the iptables calls complete successfully but the container isn't actually exposed. We'll probably need to use the ambassador pattern to do this properly.
2015-08-31 15:29:23 -04:00
Jose Diaz-Gonzalez
075a39fe13 Move alias, link, unlink and logs commands into functions 2015-08-29 03:18:34 -04:00
Jose Diaz-Gonzalez
3fcdb0b869 Move service checks into commands file 2015-08-29 02:58:38 -04:00
Jose Diaz-Gonzalez
08f90bf4c6 Move info and list commands into shared functions
Also add better output formatting for both commands
2015-08-29 02:53:39 -04:00
Jose Diaz-Gonzalez
ce5e9086c2 use config for ports 2015-08-29 02:37:50 -04:00
Jose Diaz-Gonzalez
5736336276 Use central config for env vars 2015-08-29 01:52:55 -04:00
Jose Diaz-Gonzalez
53e54f0938 quiet grep output 2015-08-28 23:26:05 -04:00
Jose Diaz-Gonzalez
f13cdb52da Ensure container exists before attempting to kill it 2015-08-25 17:21:29 -04:00
Jose Diaz-Gonzalez
1f3d9a7d91 Fix logs subcommand 2015-08-23 22:07:12 -04:00
Jose Diaz-Gonzalez
c64b7c07be initial commit 2015-08-23 19:17:51 -04:00