Commit Graph

75 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
a309b0d1fe feat: add plugin trigger for service creation and deletion 2021-02-25 19:54:59 -05:00
Robin Speekenbrink
c2e58c773e Faster exporting for innodb tables
Since InnoDB is the standard, i'd like to add the option `--single-transaction --quick` to the mysqldump command. This should speed up larger database exports without tearing the environment up whilst doing so... 
(see https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_single-transaction)

Another way would be to allow for custom config to be loaded which inludes a optional `[mysqldump]` section... 

Another (even better perhaps) solution would be to have non-s3-backup command that utilizes the i.e. percona xtrabackup as the backup mechanism (and restore) but that changes from simple SQL backups to more advanced full database stuff...
2020-09-25 10:20:32 +02:00
Jose Diaz-Gonzalez
49c00a0479 fix: allow config directory to be configurable
For postgres, the config directory doesn't actually exist, so adding this configurability allows the plugin's info command to report correctly.
2020-05-16 02:49:34 -04:00
Jose Diaz-Gonzalez
3e7269293e feat: move all image names to config file
This allows us to more quickly update the image versions in use for tertiary images.
2020-03-30 20:09:03 -04:00
Jose Diaz-Gonzalez
dc3bb16cfe chore: update dokku/wait version 2019-12-27 16:57:13 -05:00
Jose Diaz-Gonzalez
c585944582 chore: move to helper functions for fetching passwords 2019-07-11 16:34:35 -07:00
Jose Diaz-Gonzalez
3c28a9f2a7 feat: update ambassador, s3backup, and wait images 2019-07-11 14:31:47 -07:00
Jose Diaz-Gonzalez
4f7e01973a fix: ensure the tracked container id is up to date
If the ID file contained an incorrect value, calling :start would say the service is started but :info would still show the container as missing.

Also fix an issue where docker inspect leaked stderr when the container was missing.

Refs dokku/dokku-redis#133
2019-06-11 15:44:54 -04:00
Jose Diaz-Gonzalez
ce916eb846 feat: re-allow dashes in names
This PR allows dashes in service names, while still sanitizing them before they are used as database names. If the datastore is pre-existing, the datatabase name is assumed to be the same as the service name, and returned appropriately.
2019-05-30 17:03:48 -04:00
Jose Diaz-Gonzalez
6fe30de9f2 chore: run shfmt 2019-05-30 11:06:25 -04:00
Jose Diaz-Gonzalez
686f692cb2 feat: switch to updated wait image 2019-03-25 12:46:42 -04:00
Jose Diaz-Gonzalez
be0dbe5c5c fix: correct handling of container retrieval
In the previous method, if the container was renamed or there were multiple names attached to the container, fetching the container ID would fail as the regex would only match at the end. Instead of using grep, use the docker 'filter' functionality to fetch the container ID as appropriate.
2019-03-25 12:37:35 -04:00
Jose Diaz-Gonzalez
fc3f6a8a52 fix: correct the validation message 2019-03-09 16:39:34 -05:00
Jose Diaz-Gonzalez
1551ec61e7 fix: Strictly validate service names
We previously allowed a wide range of service names. As the service name is sometimes used to name databases, the name was actually more restricted than any character, resulting in services that wouldn't start. Going forward, only alphanumeric and underscore characters are allowed.

This only impacts service creation. Any services with invalid names should be migrated to a new service, with the data exported and imported as normal.

Closes dokku/dokku-redis#99
Closes dokku/dokku-mysql#47
Closes dokku/dokku-mongo#86
Closes dokku/dokku-redis#81
2019-03-09 15:54:21 -05:00
Jose Diaz-Gonzalez
1b797f8024 chore: minor consolidation in functions files 2019-03-09 15:54:21 -05:00
Jose Diaz-Gonzalez
39a7864022 fix: correct issues where docker ps is truncated
This should actually be refactored to avoid the grep call completely, but the current fix will correct the issue for now.

Refs dokku/dokku-postgres#131
2018-12-02 14:29:24 -05:00
Jose Diaz-Gonzalez
284ffa3177 feat: add ability to upgrade service image and image-version 2018-10-10 00:13:59 -04:00
Jose Diaz-Gonzalez
c83e0a56d2 refactor: make variable as dns hostname more clear 2018-04-24 02:54:46 -04:00
Jose Diaz-Gonzalez
02b0c1c7f9 refactor: move unimplemented command detection into config file 2018-04-24 00:27:17 -04:00
Jose Diaz-Gonzalez
94221b71ce refactor: allow usage of the same variable to disable docker pulls 2018-04-23 06:56:41 -04:00
Jose Diaz-Gonzalez
606fc7f9be feat: use custom env var to disable pull actions 2018-04-11 15:11:39 -04:00
Jose Diaz-Gonzalez
793087097d feat: support a separate data root for Docker bind mounts
This does not fix the :backup subcommand, which uses a temporary directory mounted to /backup.
2018-04-10 23:22:30 -04:00
Dheeraj Panyam
f92d6c2120 Update functions 2018-02-18 12:28:04 +05:30
Dheeraj Panyam
397a349b23 service_import ( change user from mysql to root)
change user from mysql to root
2018-02-18 10:26:50 +05:30
Dheeraj Panyam
b3e7735d0d service_import()
service_import() {
  local SERVICE="$1"
  SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
  SERVICE_NAME="$(get_service_name "$SERVICE")"
  ROOTPASSWORD="$(cat "$SERVICE_ROOT/ROOTPASSWORD")"

  if [[ -t 0 ]]; then
    dokku_log_fail "No data provided on stdin."
  fi
  docker exec -i "$SERVICE_NAME" mysql --user=mysql --password="$ROOTPASSWORD" "$SERVICE"
}
2018-02-17 23:42:50 +05:30
Jose Diaz-Gonzalez
e5bead2f82 feat: add support for enhanced help output 2017-09-11 01:25:25 -04:00
Jose Diaz-Gonzalez
afcfc0253c feat: add ability to specify custom flags on clone/create
Refs dokku/dokku-redis#64
2017-08-26 18:10:31 -04:00
Youri van der Lans
db956c3bbf Suppress mysqldump password error. 2017-03-14 14:50:43 +01:00
Jose Diaz-Gonzalez
cc5fac0376 feat: add s3 backup support 2016-10-31 11:39:25 -06:00
Tomas Srna
e979c8d414 Use utf8 character set as default 2016-10-10 11:41:14 +02:00
Jose Diaz-Gonzalez
85ceaee1d1 Pin dokkupaas/wait:0.2 2016-09-21 01:27:01 -06:00
Jose Diaz-Gonzalez
757ae311f9 Move link creation up 2016-08-29 10:47:23 -04:00
Jose Diaz-Gonzalez
87084e7135 Refactor common functions into separate file 2016-08-29 02:36:09 -04:00
Jose Diaz-Gonzalez
ff5459d299 Add --internal-ip flag to info command 2016-08-28 23:24:20 -04:00
Jose Diaz-Gonzalez
0b7be2d039 Fix expose tests 2016-08-28 22:15:07 -04:00
Jose Diaz-Gonzalez
f7d461fbf9 Document exposed ports when an invalid number of arguments are specified 2016-08-28 21:24:48 -04:00
Jose Diaz-Gonzalez
1841aa258c Add --id flag 2016-08-28 17:55:51 -04:00
Jose Diaz-Gonzalez
7a8d24931a Add support for flags on the service:info command 2016-08-28 05:37:34 -04:00
Jose Diaz-Gonzalez
2c26bf8896 Use cat and double-quotes when retrieving the password 2016-08-27 01:34:58 -04:00
Jose Diaz-Gonzalez
1eb8d990e2 Add missing SERVICE_ROOT env var 2016-08-27 01:10:32 -04:00
Jose Diaz-Gonzalez
37dcf26ba8 Output the config/data directories when performing service:info 2016-08-27 00:57:08 -04:00
Jose Diaz-Gonzalez
01210083dc Only wait for a single port 2016-08-26 23:05:27 -04:00
Jose Diaz-Gonzalez
e58c187889 Fix calls to docker-options plugin under all 0.4.x releases 2016-06-09 12:31:42 -04:00
Jose Diaz-Gonzalez
2a2132eb0b Alphabetize functions to improve organization 2016-05-16 02:28:41 -04:00
Jose Diaz-Gonzalez
69779da97d Remove remaining direct dokku calls 2016-05-16 00:24:38 -04:00
Jose Diaz-Gonzalez
f1731bac00 Remove call to dokku service:info in favor of service_info 2016-05-15 19:36:08 -04:00
Jose Diaz-Gonzalez
3e4409fcfb Use docker-options functions directly to avoid setting DOKKU_APP_NAME twice 2016-05-15 19:29:45 -04:00
Jose Diaz-Gonzalez
4e32b0a154 Revert "Escape dashed names for older versions of mysql"
This reverts commit 47398f84d6.
2016-05-12 12:05:02 -04:00
Jose Diaz-Gonzalez
b448a83c1e quote SERVICE_NAME value 2016-05-08 15:00:01 -04:00
Jose Diaz-Gonzalez
14c5dc8ebe use an extension for sed calls on os x 2016-05-08 14:59:51 -04:00