Skip to content

Commit aa63dd3

Browse files
committed
Merge pull request alphagov#196 from alphagov/app-console
Run an application's console
2 parents 8bc8527 + b486860 commit aa63dd3

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from fabric.api import sudo, task
2+
from util import bundle_exec
23

34

45
@task
@@ -37,5 +38,11 @@ def status(app):
3738
_service(app, 'status')
3839

3940

41+
@task
42+
def rails_console(app):
43+
"""Attach to a Rails application's console"""
44+
bundle_exec(app, 'rails console')
45+
46+
4047
def _service(app, command):
4148
sudo('service {} {}'.format(app, command))

requirements_for_tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-r requirements.txt
2-
flake8
2+
flake8==2.5.1

vm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ def free():
1616
"""Show memory stats"""
1717
run('free')
1818

19+
1920
@task
2021
def top_mem_proc():
2122
"""Show top processes by memory usage"""
2223
run('ps aux |sort -rk4 |head')
2324

25+
2426
@task
2527
def disk():
2628
"""Show disk usage"""

0 commit comments

Comments
 (0)