Python虚拟环境流程管理器
项目描述
The Procfile & Deployfile process manager for Python Virtual Environments.
Bureaucrat提供基于Deployfile的部署任务管理的支持。Deployfile基本上是另一个名字的Procfile。它用于定义项目的部署命令并启动运行它所需的过程。
Deployfile命令必须是幂等的。
如果您使用Docker,您可能会发现这有助于自动化容器的构建。
安装
使用以下命令从PyPI安装
pip install bureaucrat
或从源代码安装
pip install git+https://github.com/adlibre/python-bureaucrat.git#egg=bureaucrat
配置
要使用Bureaucrat,您需要在虚拟环境根目录下创建Procfile、Deployfile和.env文件。
示例Procfile
以下将启动一个单独的gunicorn网络进程。
web: gunicorn project.wsgi:application --workers $WORKERS --log-file $LOGFILE --bind 0.0.0.0:$PORT --timeout 300
示例Deployfile
以下适用于部署Django应用程序。
pip: pip install -r requirements.txt migrate: manage.py migrate --noinput collectstatic: manage.py collectstatic --noinput
示例.env
WORKERS=4 LOGFILE=/var/log/django-project.log PORT=8000
用法
基本选项是start、stop、restart、deploy和init。
usage: Bureaucrat [-h] {start,stop,restart,deploy,init} ...
Bureaucrat - the Procfile & Deployfile manager for Python Virtual Environments
positional arguments:
{start,stop,restart,deploy,init}
start Starts Procfile processes
stop Stops Procfile processes
restart Restarts Procfile processes
deploy Run tasks in Deployfile
init Run Deployfile tasks and then start Procfile processes
in foreground
optional arguments:
-h, --help show this help message and exit
启动/停止/重启参数
指定自定义位置以指定Procfile、.env和日志文件的额外参数。
usage: Bureaucrat start [-h] [--venv VENV] [--app APP] [--procfile PROCFILE]
[--envfile ENVFILE] [--logpath LOGPATH]
[--pidpath PIDPATH]
[process [process ...]]
positional arguments:
process Procfile Process Name
optional arguments:
-h, --help show this help message and exit
--venv VENV Virtualenv root
--app APP Application root
--procfile PROCFILE Procfile path
--envfile ENVFILE .env file path
--logpath LOGPATH log file path
--pidpath PIDPATH pid file path
示例
$ bureaucrat start Spawning web: gunicorn project.wsgi:application --log-file log/gunicorn.$LOGFILE --bind unix:run/gunicorn.sock
部署参数
usage: Bureaucrat deploy [-h] [--venv VENV] [--app APP]
[--deployfile DEPLOYFILE] [--envfile ENVFILE]
[--logpath LOGPATH]
optional arguments:
-h, --help show this help message and exit
--venv VENV Virtualenv root
--app APP Application root
--deployfile DEPLOYFILE
Deployfile path
--envfile ENVFILE .env file path
--logpath LOGPATH log file path
示例
$ bureaucrat deploy Running task syncdb: manage.py syncdb --noinput Running task migrate: manage.py migrate --noinput Running task collectstatic: manage.py collectstatic --noinput
状态
该版本由Panubo用于支持Python环境。
项目详情
关闭
bureaucrat-0.3.6.tar.gz的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 2d29890e8c96d606c14776ce5d12dbdd3a7502821dcb270180ac9e4056acd4b2 |
|
| MD5 | dbfaee6128b342b1acb768904bc5a928 |
|
| BLAKE2b-256 | e80849b6682d8b0f3af36efe734dee3d22aa3d06b85b9d5d58db8aa1f991597b |