Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
这只是个demo程序,实际运行时,还可能需再调整

整个过程都依赖SSH服务,通过ssh远程调用命令及获得返回值来判定命令是否执行正确
这里Python只是做到了胶水语言的作用。
还可以直接使用python的ssh模块,更简洁些::

   import ssh
   # 连接一个ssh服务器
   s = ssh.Connect(host, username='foo', password='123')
   # 上传一个文件
   s.put(local_file, remote_file)
   # 执行一条命令
   s.exectue('ls -l')

TODO
====

* [ ] 配置当前的用户的ssh文件,增加ControlMaster加快链接速度
* [ ] 拷贝公钥到每台机器,免密码输入验证
* [X] 编译nginx安装脚本
* [O] 部署脚本
    * [X] 拷贝nginx的源代码及相关模块依赖
    * [X] 拷贝编译nginx的脚本,并执行
    * [ ] 配置文件: 根据配置文件选项生成不同的nginx配置文件
    * [X] 多进程并发执行
    * [X] 记录失败的机器
        * [X] 根据命令返回值记录编译脚本是否执行成功
        * [ ] nginx -t 测试nginx.conf
        * [X] 验证远程nginx.conf 的内容是否跟配置要求的内容一致

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.