Commit Graph

81 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
e19b52442b fix: remove deprecated egrep calls from codebase 2020-02-17 05:59:52 -05:00
Jody McIntyre
f1dd722971 Update DOKKU_SCALE from Procfile during ps:scale
This is needed so that we report on processes added to an app's
Procfile.
2019-10-04 08:35:58 -04:00
Jose Diaz-Gonzalez
3ca6245b00 fix: use 6 X to support running under busybox
mktemp from busybox requires that all templates end with XXXXXX.
2019-08-12 18:16:16 -04:00
Jose Diaz-Gonzalez
925c6c4c28 feat: inject the dokku PID into temporary files/directories
This will allow background processes to cleanup these files if they were unable to be cleaned up during a run of the dokku binary, as is the case for files copied by the docker binary when running in docker.
2019-08-12 17:56:17 -04:00
Jose Diaz-Gonzalez
7dbeffd041 chore: drop unnecessary stdout redirect to /dev/null 2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
d326c17dfb chore: standardize on writing to file versus a destination 2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
fc5544ac70 refactor: use a single method for running the ps:*all commands
This reduces the duplication at the cost of slightly more complexity.
2019-06-10 13:05:57 -04:00
Jose Diaz-Gonzalez
e276ebbc27 feat: add support for pulling app status from scheduler plugins
Previously, this was impossible to do if using an alternative scheduler.
2019-05-28 14:53:42 -04:00
Jose Diaz-Gonzalez
1b92f4a97e chore: standardize how temporary files are named 2019-05-20 18:01:17 -07:00
Jose Diaz-Gonzalez
da4361583b fix: reverse quotes for variable expansion
Without reversing quotes, the variables are sometimes improperly expanded, resulting in files not being removed.
2019-05-20 17:56:50 -07:00
Jose Diaz-Gonzalez
4264380e15 feat: disable scaling if app contains DOKKU_SCALE file
A DOKKU_SCALE file will always be used for managing the scale count for an app if it exists in a repository. As such, ps:scale usage should be disabled in those cases. This commit makes that more apparent.

Also document how to build a specific core plugin for testing purposes.

Closes #3544
2019-05-18 15:24:59 -07:00
Jose Diaz-Gonzalez
0275c65b8a feat: add support for quiet ps:scale output
The previous output required too much parsing to be used in an automated fashion. This change makes that a bit easier, without sacrificing usability.

Note that the output is quite a bit different from heroku. This is purposeful as we do not have the concept of dynos.

Closes #3520
2019-05-06 11:19:08 -04:00
Jose Diaz-Gonzalez
97fe3f56b7 fix: Always allow ps:scale proc=0
With the introduciton of procfile-util, scaling a non-existent process to 0 was disabled. This brings back that functionality, allowing users to scale all processes to 0. This is especially useful when a user has accidentally scaled a non-existent process up, causing deploys to fail without any way to revert outside of manually editing files.

Closes #3428
2019-04-16 23:04:45 -04:00
Jose Diaz-Gonzalez
520a72078e fix: remove useless cat 2019-03-13 14:12:35 -04:00
Jose Diaz-Gonzalez
c701429a05 chore: quiet down logging around scale declarations 2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
67ae374e60 lint: remove whitespaces before redirect 2019-02-02 13:49:24 -05:00
Jose Diaz-Gonzalez
86795ddacc tests: run mvdan/shfmt on test runs
While I do not agree with _every_ style change, this will force Dokku to have consistent formatting across all shell scripts, which is arguably a Good Thing™.

The command used to reprocess everything is:

```shell
shfmt -l -bn -ci -i 2 -w .
```
2019-01-07 01:25:55 -05:00
Jose Diaz-Gonzalez
05240c56b6 fix: reference correct variable for procfile 2018-10-13 20:17:51 -04:00
Jose Diaz-Gonzalez
64c6437e4e hack: pull procfile if possible when setting ps:scale 2018-10-11 20:19:57 -04:00
Jose Diaz-Gonzalez
81935a8f31 feat: drop debugging info 2018-10-11 20:19:57 -04:00
Jose Diaz-Gonzalez
7f6688c01a hack: log the procfile and more 2018-10-11 20:19:56 -04:00
Jose Diaz-Gonzalez
95292bfcba fix: correct issue where we accidentally bailed when there was no error 2018-10-11 20:19:56 -04:00
Jose Diaz-Gonzalez
0292c4ee3b refactor: move get_cmd_from_procfile to ps/functions
Procfile handling should only be performed in the ps plugin
2018-10-11 20:19:56 -04:00
Jose Diaz-Gonzalez
afd101034d feat: verify that a process exists before scaling it
Refs #2582
Refs #3196
2018-10-11 20:19:56 -04:00
Jose Diaz-Gonzalez
b6fe31f9cb fix: call procfile-util correctly 2018-10-11 20:19:56 -04:00
Jose Diaz-Gonzalez
2db8f93507 feat: error out on Procfile extraction if the procfile is invalid
Refs #2991
Refs #3196
2018-10-11 20:19:56 -04:00
Jose Diaz-Gonzalez
ed190527ce feat: allow overriding the scheduler globally
Being able to override globally is useful for cases where a user will _always_ want their applications to be globally distributed
2018-09-30 21:36:53 -04:00
Jose Diaz-Gonzalez
9b41f7a74e fix: use updated fn-ps-is-app-running function to determine an application's status
In some cases, a single allocation for a service may not be running, but the others will, and `is_app_running` will return the wrong thing.

Closes #2772
2018-04-28 01:21:26 -04:00
Jose Diaz-Gonzalez
8d07ffe775 refactor: deprecate is_app_running in favor of ps#fn-ps-is-app-running
This will allow us to _actually_ introspect on the running state of an application. In certain cases, the detected state can be "mixed", meaning that we may need to take action, depending on what we want to do in mixed mode.
2018-04-28 01:19:23 -04:00
Jose Diaz-Gonzalez
e47f6e5803 fix: use dokku_log_warn helper for warning messages in the ps plugin 2018-04-28 01:13:48 -04:00
Jose Diaz-Gonzalez
8474c72a10 refactor: move container stopping into new scheduler-stop plugin trigger 2018-04-06 22:53:02 -04:00
Jose Diaz-Gonzalez
71b578bf10 fix: Properly handle invalid process type entries during DOKKU_SCALE generation
Closes #2991
2018-03-07 21:48:20 -05:00
Jose Diaz-Gonzalez
76dd0252ee feat: add pre-start trigger for notifying on application start
Closes #2713
2017-12-19 00:55:10 -05:00
Jose Diaz-Gonzalez
647efab2dd fix: ensure we always call proxy-build-config when calling ps_start 2017-10-02 15:05:13 -07:00
Jose Diaz-Gonzalez
ed7d5623ad fix: attempt to pass shellcheck on os x 2017-03-26 04:38:35 -06:00
Jose Diaz-Gonzalez
1cbdde748e Merge pull request #2290 from dokku/1734-restart-policies
Implement restart-policy handling
2016-07-30 15:10:37 -04:00
Jose Diaz-Gonzalez
cb9c5b6988 Merge pull request #2317 from dokku/jg-cert-remap-http-to-https
Properly remap http port 80 mappings to https 443 when adding an ssl certificate
2016-07-30 15:09:53 -04:00
Jose Diaz-Gonzalez
2474c87bbd Pull the deploying app image name where necessary
All of these commands should execute against the image that is in use versus the "latest" that dokku provides the system with.
2016-07-29 12:49:29 -04:00
Jose Diaz-Gonzalez
de550094da Standardize parenthesis usage for is_deployed 2016-07-23 16:04:13 -04:00
Michael Hobbs
a269f8e003 support --quiet and split up data access from presentation 2016-07-17 15:56:11 -07:00
Jose Diaz-Gonzalez
59c9207797 Implement restart-policy handling. Closes #1734
Applications without a restart-policy will have their policies set to `on-failure:10`. Users can completely unset the restart-policy using the `docker-options` plugin, though this will be equivalent to setting it explicitly to `no`.

Restart policies must be explicitly set, and the following are all valid:

- no
- unless-stopped
- always
- on-failure
- on-failure:NUMBER
2016-07-02 17:22:54 -04:00
Michael Hobbs
cb8a9648c9 support WORKDIR location for DOKKU_SCALE. refs #2226 2016-06-06 17:45:33 -07:00
Michael Hobbs
166f7f38e4 pass image tag from release_and_deploy down through extract_procfile. closed #2226 2016-06-06 11:31:59 -07:00
Jose Diaz-Gonzalez
377412f9f8 remove DOKKU_PROCFILE before attempting to extract it 2016-05-31 17:02:25 -04:00
Tobias Brunner
ee18909935 allow all apps to be restored on boot
When rebooting a Dokku host the init process tries to restore all apps
using `dokku ps:restore`, alphabetically. If an app is defined but not
deployed, the function `ps_start` called by `dokku ps:restore` will
exit 0 and stop trying to restore the other apps later in the alphabet.
This change fixes the restore behaviour.
2016-05-10 11:41:25 +02:00
Michael Hobbs
cb9efa3322 implement docker stop timeout. closes #2126 (#2148) 2016-04-26 18:06:55 -07:00
Michael Hobbs
9ce7470b87 remove deprecated mktemp args and name vars more clearly 2016-03-29 19:46:46 -07:00
Stefan Siegl
088ee071ca Fix ps_restart to not exit
ps_restartall_cmd calls ps_restart from a loop, if ps_restart exits because of a not deployed app further apps might not be restarted.
2016-03-28 20:34:17 +02:00
Michael Hobbs
987c5cfb9c use declare for description variable 2016-03-08 15:30:34 -05:00
Michael Hobbs
aa2415eeb8 more style/function tweaks 2016-03-03 22:11:35 -08:00