Skip to content

Commit

Permalink
Add ps:scale (#24)
Browse files Browse the repository at this point in the history
* Add ps:scale

* Update ps.rb

* Update README.md
  • Loading branch information
fluke authored and SebastianSzturo committed Jan 16, 2018
1 parent eed365d commit c4ff14c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Commands:
dokku ps:rebuild # Rebuild the app
dokku ps:restart # Restart the app container
dokku ps:start # Start the app container
dokku ps:scale # List the current scale of Procfile processes
dokku ps:scale proc1=scale1 [proc2=scale2 ...] # Scale one or more Procfile processes
dokku run <cmd> # Run a one-off command in the environment of the app
dokku ssh # Start an SSH session as root user
dokku url # Show the first URL for the app
Expand Down
12 changes: 11 additions & 1 deletion lib/dokku_cli/ps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ class Cli < Thor
map "ps:rebuild" => "ps_rebuild",
"ps:restart" => "ps_restart",
"ps:start" => "ps_start",
"ps:stop" => "ps_stop"
"ps:stop" => "ps_stop",
"ps:scale" => "ps_scale"

desc "ps", "List processes running in app container(s)"
def ps
Expand All @@ -30,5 +31,14 @@ def ps_start
def ps_stop
run_command "ps:stop #{app_name}"
end

desc "ps:scale", "Scale the app processes"
def ps_scale(*processes)
if processes.empty?
run_command "ps:scale #{app_name}"
else
run_command "ps:scale #{app_name} #{processes.join(' ')}"
end
end
end
end

0 comments on commit c4ff14c

Please sign in to comment.