57 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
129691eb6e fix: ensure we continue on with logic if the error returned from fetching all apps is NoAppsExist
This makes it so we don't accidentally skip logic that happens after iterate over the apps.
2025-12-05 20:16:15 -05:00
Jose Diaz-Gonzalez
e134c314ea feat: implement config:import command
Closes #6846
2025-11-08 01:02:19 -05:00
Jose Diaz-Gonzalez
9d711cbb44 fix: expand variables for release tasks
Procfile commands need to be expanded with actual environment variables as procfile-util will otherwise empty them out. This doesn't happen for app.json scripts as they are never expanded until the docker container gets created.

Closes #8050
2025-10-19 23:33:12 -04:00
Jose Diaz-Gonzalez
577f46153f refactor: use helper go functions to handle extracting files from a repository
This standardizes the extraction code and makes it easier to reuse in future implementations of file extraction.

Additionally, this adds a way to extract folders from codebases.
2025-07-23 18:16:16 -04:00
Jose Diaz-Gonzalez
1eb41f32dc feat: only redeploy formations that have had their values changed
Rather than redeploy every formation, only deploy formations that have had their values changed from the defaults.

This still doesn't handle the case where we touch existing processes when scaling _up_, but should decrease the number of services touched otherwise during scaling.

Also note that there are no tests for this new behavior yet (tests incoming).

Refs #7396
2025-06-23 04:42:09 -04:00
Jose Diaz-Gonzalez
9beab4d50d refactor: migrate DOKKU_DOCKER_STOP_TIMEOUT to ps setting 2025-06-09 11:39:00 -04:00
Jose Diaz-Gonzalez
ad5537c086 refactor: directly trigger pre-deploy hook from post-release-builder script
This removes the extra indirection in the deploy process for triggering the hooks.
2024-04-04 02:27:43 -04:00
Jose Diaz-Gonzalez
cdff4ae867 refactor: use CallPlugnTrigger instead of PlugnTriggerOutput
Refs #6422
2024-03-14 01:18:28 -04: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
31abd7e31e chore: always sort returned formations 2024-02-11 21:12:25 -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
eb6f85f083 feat: skip scaled processes that are missing in the Procfile
This allows folks to deploy apps that don't have a web process without needing to scale that process down before/after the first deploy. Note that the formations key in the app.json or a manual scale of other processes will be necessary to start anything non-web.

Closes #5700
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
af84293c3e fix: ensure we migrate data for all golang plugins 2023-02-14 03:08:02 -05:00
Jose Diaz-Gonzalez
3f82c525ad chore: use helper to check if there is a Procfile 2023-02-14 03:08:02 -05:00
Jose Diaz-Gonzalez
a53ead6c64 chore: rename function 2023-02-14 03:08:02 -05:00
Jose Diaz-Gonzalez
5dcc1cb13c refactor: remove support for DOKKU_SCALE file
It has been replaced by the 'formations' key within the 'app.json' file format.
2023-01-15 23:53:03 -05:00
Jose Diaz-Gonzalez
6cbe93c245 refactor: move all golang code for managing data directories to common plugin
Additionally, ensure the golang plugins handle setup/teardown of plugin and app-specific data directories during install, rename, and clone phases.
2023-01-08 23:36:12 -05:00
Jose Diaz-Gonzalez
e01730857c fix: overwrite the in-repo Procfile with the desired Procfile
Without this change, herokuish and pack builds would not run the correct command as the Procfile could still be the old Procfile.
2022-12-28 15:36:34 -05:00
Jose Diaz-Gonzalez
21bb5ea2ed fix: delete existing Procfile if the user tried to overwrite it with a non-existing one
This behavior follows what is described in the documentation.
2022-12-28 15:34:53 -05:00
Jose Diaz-Gonzalez
c3c6e2174a fix: keep track of the source image when building an app via git:from-image
This change fixes issues with ps:rebuild not working as expected - essentially ignoring files in the repo - as well as adds tests.

Closes #5518
2022-12-18 17:57:24 -05:00
Jose Diaz-Gonzalez
e458c8e4a6 fix: keep track of old scale values for a single deploy
This will ensure we scale things down after usage.
2022-11-27 15:02:45 -05:00
Jose Diaz-Gonzalez
171dad8e88 feat: add method for pulling files when deploying from built images
This allows us to be backwards compatible when executing git:from-image.

The nice thing about this pattern is we can also extend it to other parts of the deployment as well, such asn nginx-vhosts fetching
2022-11-25 17:38:15 -05:00
Jose Diaz-Gonzalez
0857e51c43 fix: do not delete the existing procfile if it does not exist 2022-11-25 14:50:35 -05:00
Jose Diaz-Gonzalez
231e562b8d fix: respect the .missing file and the process-specific procfile when fetching the a procfile command 2022-11-25 14:50:35 -05:00
Jose Diaz-Gonzalez
1455390dd3 fix: reference the correct missing file 2022-11-25 14:50:35 -05:00
Jose Diaz-Gonzalez
fe4d80a82b refactor: cleanup zero'd out processes when a Procfile omitting those process types is set
This change also moves the referenced Procfile out to a host path once on deploy vs potentially several times, which should speed up deploys a small amount and simplify reasoning about the file.

Closes #5112
2022-11-25 14:50:35 -05:00
Jose Diaz-Gonzalez
268c318bc5 fix: ensure we do not filter apps for certain commands and triggers
Some things must pull *all* apps vs filtered apps (mostly things that write out config files or install triggers). Using an unflitered list is best.

Also, we default to filtering, which should be what most usage needs.
2022-05-15 15:47:13 -04:00
Jose Diaz-Gonzalez
43631e8847 fix: do not error when default Procfile path does not exist when using a custom procfile-path
Closes #4870
2021-10-16 16:34:34 -04:00
Jose Diaz-Gonzalez
30a15aaa7a fix: respect pre-deploy task image manipulation
This requires a bc-incompatible break in terms of what triggers the pre-deploy hook (dokku internals vs schedulers).
2021-08-05 04:17:21 -04:00
Jose Diaz-Gonzalez
7058989941 chore: delete this file on import 2021-08-01 22:34:42 -04:00
Jose Diaz-Gonzalez
fcd16e849d fix: set correct initial formation 2021-08-01 19:06:25 -04:00
Jose Diaz-Gonzalez
a7593db0c3 refactor: allow specifying clearExisting when calling ps-set-scale 2021-08-01 17:54:12 -04:00
Jose Diaz-Gonzalez
401683a305 refactor: write DOKKU_SCALE contents to scale property
- remove extraction of DOKKU_SCALE
- migrate to property system
- rewrite internals to use a FormationSlice instead of a map
2021-08-01 17:47:04 -04:00
Jose Diaz-Gonzalez
bd4621070c feat: implement ps-can-scale 2021-08-01 16:27:13 -04:00
Jose Diaz-Gonzalez
ef262c26e8 feat: override all existing scale parameters when calling ps-set-scale 2021-08-01 16:20:19 -04:00
Jose Diaz-Gonzalez
5ad5a29a00 docs: add godoc 2021-08-01 16:14:12 -04:00
Jose Diaz-Gonzalez
46d333df4b feat: implement ps-set-scale trigger 2021-08-01 16:13:03 -04:00
Jose Diaz-Gonzalez
33bf6f59b3 fix: do not output extra newlines 2021-08-01 15:31:59 -04:00
Jose Diaz-Gonzalez
213f7d224c refactor: use ps-current-scale instead of parsing DOKKU_SCALE file when iterating over deployed processes 2021-08-01 01:43:35 -04:00
Jose Diaz-Gonzalez
a22391b7ad fix: copy the specified Procfile into place at the earliest possibility 2021-07-10 14:57:59 -04:00
Jose Diaz-Gonzalez
c3ece32145 feat: add ability to specify a custom Procfile path 2021-07-10 14:57:56 -04:00
Jose Diaz-Gonzalez
f7863c8391 fix: handle clone and rename properly 2020-11-28 00:39:28 -05:00
Jose Diaz-Gonzalez
97513dee91 fix: handle case where deploying app image does not exist
This happens if ps:scale is called before a deploy.

Also refactor GetDeployingAppImageName() to return an error as the second return parameter.
2020-11-23 00:11:00 -05:00
Jose Diaz-Gonzalez
fceb412fb1 fix: reference extracted Procfile
Rather than attempting to always extract the Procfile, reference the one that was extracted by the last deploy. This fixes issues where 'docker container cp' may fail intermittently for lord knows what reason.

Closes #4083
2020-11-22 17:14:18 -05:00
Jose Diaz-Gonzalez
6e0c376b62 fix: correctly handle property and data perms 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez
c9a0f88bf1 fix: correct a few stickler errors 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez
bc9a60f696 feat: switch to updateScalefile from generateScalefile
The process is the same.
2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez
a8ccc7d2a7 feat: generate the scale file after app creation
The web process always starts off at `1`, so this is relatively benign.
2020-11-21 20:57:33 -05:00