项目部署,环境搭建(pip/ makefile)
1 python包管理--pip pip search 你想要的包 # 查询相关包 pip install 包名 [==版本号]; # 指定版本可选 pip freeze >requires.txt # 导出当前环境下的配置列表 pip install -r requires.txt # 根据配置列表文件安装指定版本包 2 makefile 脚本环境搭建 unix系上脚本可以做到自动化运维;执行make,会自动寻找当前目录下的makefile/Makefile文件; makefile语法: 目标 : 条件 脚本 举例: clean: find . -name '*.pyc' -delete 命令行执行 make clean 即可 3 Fabric 自动化运维利器 官网 http://www.fabfile.org/ 入门文档 http://docs.fabfile.org/en/1.10/tutorial.html 命令行fab -f 指定fabfile模块,默认当前目录下fabfile.py; -H, --hosts 指定远程主机,多个用' , '分隔,格式同 ssh的host_string,即 username@host; -l 显示当前fabfile中可用命令 --colorize-errors 错误信息作色 举个栗子~ #!/usr/bin/env python #