admin ps tweaks

This commit is contained in:
Adam Wiggins
2011-06-05 00:54:04 -07:00
parent fd640bb6df
commit a0c09e6ed7
+3 -3
View File
@@ -1,10 +1,10 @@
## XI. Admin processes
### One-off admin/management tasks
The [process formation](#) represents the array of processes that are used to do the app's regular business (such as handling web requests) as it runs. But the app's developers will often wish to do one-off administrative or maintenance tasks for the app, such as:
The [process formation](/concurrency) represents the array of processes that are used to do the app's regular business (such as handling web requests) as it runs. Separately, developers will often wish to do one-off administrative or maintenance tasks for the app, such as:
* Running database migrations (e.g. `manage.py syncdb` in Django, `rake db:migrate` in Rails).
* Running a console (also known as a REPL shell) to run arbitrary code or inspect the app's models against the live database. Most languages provide a REPL by running the interpreter without any arguments (e.g. `python` or `node`) or in some cases have a separate command (e.g. `irb` for Ruby, `rails console` for Rails).
* Run one-time scripts committed into the app's repo (e.g. `python scripts/fix_bad_records.py`).
* Running one-time scripts committed into the app's repo (e.g. `php scripts/fix_bad_records.php`).
Twelve-factor apps prefer languages which provide a REPL shell out of the box, and which make it easy to run one-off scripts. In a local deploy, developers invoke one-off admin processes by a direct shell command inside the app's checkout directory. In a production deploy, developers can use ssh or other remote command execution mechanism provided by that deploy's execution environment to run such a process.
Twelve-factor apps are best written in languages which provide a REPL shell out of the box, and which make it easy to run one-off scripts. In a local deploy, developers invoke one-off admin processes by a direct shell command inside the app's checkout directory. In a production deploy, developers can use ssh or other remote command execution mechanism provided by that deploy's execution environment to run such a process.