Skip to content

Commit c4ff14c

Browse files
flukeSebastianSzturo
authored andcommitted
Add ps:scale (#24)
* Add ps:scale * Update ps.rb * Update README.md
1 parent eed365d commit c4ff14c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ Commands:
8888
dokku ps:rebuild # Rebuild the app
8989
dokku ps:restart # Restart the app container
9090
dokku ps:start # Start the app container
91+
dokku ps:scale # List the current scale of Procfile processes
92+
dokku ps:scale proc1=scale1 [proc2=scale2 ...] # Scale one or more Procfile processes
9193
dokku run <cmd> # Run a one-off command in the environment of the app
9294
dokku ssh # Start an SSH session as root user
9395
dokku url # Show the first URL for the app

lib/dokku_cli/ps.rb

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ class Cli < Thor
44
map "ps:rebuild" => "ps_rebuild",
55
"ps:restart" => "ps_restart",
66
"ps:start" => "ps_start",
7-
"ps:stop" => "ps_stop"
7+
"ps:stop" => "ps_stop",
8+
"ps:scale" => "ps_scale"
89

910
desc "ps", "List processes running in app container(s)"
1011
def ps
@@ -30,5 +31,14 @@ def ps_start
3031
def ps_stop
3132
run_command "ps:stop #{app_name}"
3233
end
34+
35+
desc "ps:scale", "Scale the app processes"
36+
def ps_scale(*processes)
37+
if processes.empty?
38+
run_command "ps:scale #{app_name}"
39+
else
40+
run_command "ps:scale #{app_name} #{processes.join(' ')}"
41+
end
42+
end
3343
end
3444
end

0 commit comments

Comments
 (0)