Commit Graph
79 Commits
Author SHA1 Message Date
Jose Diaz-Gonzalez 3b76b81edf fix: set correct variable for app image repo 2021-01-02 18:47:48 -05:00
Jose Diaz-Gonzalez 596e7b6f24 feat: use error group to fetch the deploying app image
This is a fairly slow operation currently done serially, making ps:scale output brutally slow. Using an error group to parallelize the output is also pleasing to the eyes :)
2021-01-02 18:45:30 -05:00
Jose Diaz-Gonzalez aa0437bb23 refactor: use an error group to simplify parallel retrieval of scheduler
This makes the code a bit simpler to read and more idiomatic
2021-01-02 18:45:30 -05:00
Jose Diaz-Gonzalez e8aaacff5e refactor: simplify code 2021-01-02 06:11:34 -05:00
Jose Diaz-Gonzalez 44461e21df refactor: parallelize scheduler retrieval
In many cases, a user may only set a global scheduler, and as such we waste the initial call to get the app scheduler. Parallelizing the fetch increases the speed at which we can check for the scheduler.
2020-12-29 23:55:13 -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 d7b23b84f0 fix: allow renaming old applications to new format
0.22.0 changed allowed values for app names, making it more difficult for users to fix their app names - you need to either downgrade+rename or recreate the app. The `apps:rename`  command can now rename these old applications to the new standard.

Also drop some app name verification from internal commands. Duplicate verification doesn't help much, and though it isn't excessively slow, it does prevent us from running commands against old apps that exist.

Refs #4267
2020-12-22 13:29:32 -05:00
Jose Diaz-Gonzalez dd1962f92d fix: add missing docblock 2020-12-21 01:40:40 -05:00
Jose Diaz-Gonzalez 1439e8b30b hack: parse out the info flags for report subcommands separately
pflag doesn't ignore unspecified arguments, so they must be parsed out separately first.
2020-12-21 01:36:59 -05:00
Jose Diaz-Gonzalez c6976499ad fix: do not delete app when the app name is invalid
Let folks call apps:destroy instead.

Refs #4129
2020-12-15 01:14:30 -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 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 53a76b1353 feat: implement ps:retire 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez bb9f764b9f fix: sync code to bash implementation 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez e7ee7a1781 refactor: implement most of ps plugin in golang 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez 34343a846d chore: drop alias 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez c7becc6cad refactor: move all subprocess-related code to new file 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez 74f27480fc refactor: move all docker-related functions to new file 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez 33d3722060 refactor: move common io-related functions into new file 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez 66696d0b46 refactor: export SetPermissions function 2020-11-21 20:57:33 -05:00
Jose Diaz-Gonzalez 0f514f300e feat: prohibit non-dns names for apps and process types
This is necessary for ensuring ssl certificates can be auto-retrieved for apps, and also easing integration into schedulers that use names and process types as part of DNS records.

As well, this fixes an issue where we may potentially have invalid DNS entries when adding apps to custom networks.

Closes #4102
Closes #4114
2020-09-09 20:07:50 -04:00
Jose Diaz-Gonzalez b8b6d64f75 fix: correct stickler-ci errors and remove unused code 2020-08-31 18:44:00 -04:00
Jose Diaz-Gonzalez f27096f235 refactor: implement appjson in golang 2020-08-30 13:41:15 -04:00
Jose Diaz-Gonzalez f2a623fde0 fix: trim whitespace to ensure container ID is valid 2020-08-30 13:41:15 -04:00
Jose Diaz-Gonzalez 7ee26d41f7 fix: correct doc 2020-08-30 13:41:15 -04:00
Jose Diaz-Gonzalez 55c77773ab fix: read input correct as string 2020-08-30 13:41:15 -04:00
Jose Diaz-Gonzalez 8f671b43ae feat: add helper functions for getting global config 2020-08-30 13:41:14 -04:00
Jose Diaz-Gonzalez 6f6fa709ec feat: implement common.CopyFromImage 2020-08-30 13:41:14 -04:00
Jose Diaz-Gonzalez 5d08964699 feat: add AppHostRoot() function
This makes it a bit easier to fetch files from the host path
2020-08-30 13:41:14 -04:00
Jose Diaz-Gonzalez 45e3623ffd refactor: switch to go mod
This hopefully makes it a little easier to work with as the tooling is now based on something in golang core.

- move columnize usage to common plugin
- remove old vendor files
2020-06-28 01:11:28 -04:00
Jose Diaz-Gonzalez 4aae0f1a1d fix: do not allow slashes in app names
There is likely a better regex for the actually allowed names, but this will suffice for ensuring folks don't do weird things with their folder structures...

Closes #4013
2020-06-18 11:13:11 -04:00
Jose Diaz-Gonzalez 2e2320ec73 fix: correct comment 2020-06-02 00:51:45 -04:00
Jose Diaz-Gonzalez ce154aff09 feat: simplify flag parsing in apps plugin
Commands should be written such that they take arguments as is.
2020-05-29 01:59:50 -04:00
Jose Diaz-Gonzalez 46287cac0f feat: allow apps named tls
The `tls` name is no longer a reserved app name, and can be used by applications. This was previously a reserved app name due to it's use as a place for global SSL certificate files; Dokku has not supported global SSL certificates for many releases, and thus there is no need to reserve the name.
2020-05-08 23:58:06 -04:00
Jose Diaz-Gonzalez 7fd1882dbb fix: correct regex for invalid app names 2020-03-11 00:37:02 -04:00
Jose Diaz-Gonzalez e789504db1 fix: correct stickler issues 2020-03-10 23:56:16 -04:00
Jose Diaz-Gonzalez 7fa9b72144 feat: suppress the output of createApp
A git push requires that the first four bytes should be the line length, so not suppressing the output results in a partially failed deploy.

https://stackoverflow.com/a/8175315/1515875
2020-03-10 23:06:00 -04:00
Jose Diaz-Gonzalez b968ced6e9 refactor: first pass at rewriting apps plugin in go 2020-03-10 14:14:37 -04:00
Jose Diaz-Gonzalez 0b758d2ba0 refactor: move confirmation logic to common.go 2020-03-10 14:13:11 -04:00
Jose Diaz-Gonzalez 3f0c46d43d feat: add helper for fetching AppRoot in golang 2020-03-10 14:12:05 -04:00
Jose Diaz-Gonzalez 994e220ebf Merge pull request #3871 from dokku/proxy-go
Rewrite proxy plugin in golang
2020-02-28 05:09:20 -05:00
Jose Diaz-Gonzalez e8a31141fc fix: remove unused import 2020-02-22 17:05:27 -05:00
Jose Diaz-Gonzalez d3ef846b59 fix: correct stickler issues 2020-02-22 16:56:35 -05:00
Jose Diaz-Gonzalez 26e8524ae5 refactor: surface errors when running reports 2020-02-22 06:40:24 -05:00
Jose Diaz-Gonzalez 09b656e37e refactor: standardize plugin trigger calls 2020-02-22 06:39:33 -05:00
Jose Diaz-Gonzalez e5a9d29215 refactor: use Println in favor of Fprintln for os.Stdout 2020-02-22 04:32:51 -05:00
Jose Diaz-Gonzalez 58de433afa fix: omit 2nd value from range 2020-02-09 20:47:20 -05:00
Jose Diaz-Gonzalez 37c83e1c52 refactor: DRY up reports in golang
This unifies all the report-handling code so that plugins only need to worry about the data they wish to represent, and not the logic of actually returning it.
2020-02-09 20:37:03 -05:00
Jose Diaz-Gonzalez 9818cc6461 feat: implement container network attaching
Containers can be attached:

- after they are created, but before they are started
- after a successful deploy, but before the proxy reloads

This allows folks to have flexibility around when they would like a container to be made available to a network.
2020-02-08 19:55:29 -05:00
Jose Diaz-Gonzalez 4d9e8f5f7d refactor: unify property function implementations
Rather than reimplementing the property functions in two different languages - and potentially having compatibility issues - standardize on golang for the implementation through the use of a generated binary.

This also implements all the list functions for use with shell-based plugins.

Note that the interface to the prop binary is experimental, and it should not be used directly.
2019-11-27 16:37:10 -05:00