Commit Graph

28 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
cdff4ae867 refactor: use CallPlugnTrigger instead of PlugnTriggerOutput
Refs #6422
2024-03-14 01:18:28 -04:00
Jose Diaz-Gonzalez
44dd933638 refactor: remove all calls to common.NewShellCmd
At this point, the only usage of go-sh should be by plugin trigger calls.
2024-02-13 01:09:24 -05:00
Jose Diaz-Gonzalez
d8401a4d86 refactor: remove all calls to common.NewShellCmdWithArgs 2024-02-12 20:58:51 -05:00
Jose Diaz-Gonzalez
3c6cc68086 refactor: capture output by default
This is almost certainly the correct default for Dokku. While it's a BC break and might cause an increase in memory usage, the api is mostly internal and therefore this is safe to use.
2024-02-12 20:28:31 -05:00
Jose Diaz-Gonzalez
047a3c00f5 chore: remove default false values when calling CallExecCommand 2024-02-12 20:07:43 -05:00
Jose Diaz-Gonzalez
8a940c6e47 chore: remove all direct usage of go-sh outside of plugin trigger setup
The new way is to use CallExecCommand instead.
2024-02-12 19:29:16 -05:00
Jose Diaz-Gonzalez
c49322bd34 feat: manage vector container via compose
Using compose instead of manual docker calls allows folks to customize the vector container by using a custom compose.yml template file. This opens us up to more customizations while aligning container management with how we do other external containers (such as for the proxy plugins).

Refs #5784
2024-01-26 06:46:18 -05:00
Jose Diaz-Gonzalez
b6425ab431 fix: ensure all copied files always have line endings converted to unix-style
Closes #6490
2024-01-24 23:54:10 -05:00
Jose Diaz-Gonzalez
68fd65b25f feat: create helper function for exposing a docker image's working directory 2024-01-18 22:38:37 -05:00
Eng Zer Jun
1d186a5a81 refactor(plugins): replace deprecated io/ioutil functions
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

[1]: https://golang.org/doc/go1.16#ioutil
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-12-22 01:59:22 +08:00
Jose Diaz-Gonzalez
64ff701cd8 fix: clean up local build images immediately after an image is released
In some cases, we might hold onto intermediate images until the next deploy. While these images are generally part of newer images - and are therefore cleaned up when the child images are no longer in use - they cruft up the 'docker image ls' output, causing some folks to believe Dokku is not cleaning up images.

Refs #6272
2023-10-14 22:36:31 -04:00
Jose Diaz-Gonzalez
4436bb2023 chore: standardize on ls subcommand when interacting with the docker binary
The ls command is what is referenced in the --help output for the subcommands, so we should just use that everywhere.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
5dc2f20432 fix: remove all containers and images by label on app destroy
Previously, we would filter containers and images by name, which could be fail if the app was renamed or no longer was tagged "correctly" due to a rebuild. Now, we filter by label, ensuring an app is completely cleaned up on deletion.

Also:

- Move docker image cleanup from apps plugin to builder plugin: This isn't where it belongs - images should be cleaned up in a builder plugin (or the builders plugin) and not in the apps plugin, which has nothing to do with docker images anyways.
- Remove the code from the scheduler plugin, as that will only do anything if the scheduler is enabled for the app.
- Bypass image removal if there are no images to remove
- Always delete app containers: The herokuish builder creates intermediate build containers - something that should be refactored - and ideally this gets run in that builder plugin, but keeping the logic here ensures we don't have code duplication. This is otherwise safe as it will be a no-op if there are no containers to clean up.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
40b20e0c08 refactor: move herokuish app cache from the filesystem into a docker volume
This simplifies cache referencing and also paves the way for removing more from the app git directory.

Refs #1558
2023-08-05 10:35:54 -04:00
Jose Diaz-Gonzalez
652a9ec26c chore: switch to correct trigger when getting a global argument
While both will now work, using the correct trigger will skip some extra logic.
2022-07-29 22:45:23 -04:00
Jose Diaz-Gonzalez
e8d9982330 chore: drop unnecessary scheduler-docker-cleanup hook
All the logic was already called from docker-cleanup, so this just lengthened the cleanup time.
2021-08-08 01:57:44 -04:00
Jose Diaz-Gonzalez
93bd3cd9e3 fix: add godoc 2021-08-04 21:49:40 -04:00
Jose Diaz-Gonzalez
9a845664e1 feat: implement image cleanup 2021-08-04 21:49:14 -04:00
Jose Diaz-Gonzalez
d48cf24c4d fix: unify IsImageHerokuishBased with shell version
Really we should just spit this out into a bin and then have the shell version wrap the golang ones...
2021-02-11 06:49:19 -05:00
Jose Diaz-Gonzalez
5614475521 refactor: reverse if statements
The shell version of IsImageHerokuishBased returns true if it is CNB for legacy reasons...
2021-02-11 06:48:38 -05:00
Jose Diaz-Gonzalez
b826770687 fix: add cnb fix to copy_from_image 2021-02-11 06:43:37 -05:00
Jose Diaz-Gonzalez
4bbee232d8 fix: handle error cases in starting a new vector container 2021-01-07 00:12:44 -05:00
Jose Diaz-Gonzalez
711945147b refactor: use --watch-config instead of signaling the container to reload config 2021-01-04 21:48:28 -05:00
Jose Diaz-Gonzalez
d6acf5530e fix: add some comments 2021-01-04 01:14:40 -05:00
Jose Diaz-Gonzalez
fd85b1f605 feat: add vector integration
This currently is missing a few features:

- global sinks
- logrotation

But works fairly well otherwise.
2021-01-04 00:30:22 -05:00
Jose Diaz-Gonzalez
65d7fd9cce refactor: drop extra internal calls to VerifyAppName
These are duplicative of the checks that happen at the subcommand level.
2020-12-27 15:14:11 -05:00
Jose Diaz-Gonzalez
8c14bb9aeb fix: ensure all byte output is trimmed of whitespace
This otherwise causes issues when interpreting the output as part of a variable, such as when constructing the deploying app image.

Closes #4229
2020-12-13 02:04:35 -05:00
Jose Diaz-Gonzalez
74f27480fc refactor: move all docker-related functions to new file 2020-11-21 20:57:33 -05:00