Questions tagged «automated-deploy»

9
通过架构以部署用户身份激活virtualenv
我想在本地运行我的结构脚本,这将依次登录到我的服务器,切换用户以进行部署,激活项目.virtualenv,这将把dir更改为项目并发出git pull。 def git_pull(): sudo('su deploy') # here i need to switch to the virtualenv run('git pull') 我通常使用来自virtualenvwrapper的workon命令,该命令提供激活文件,后激活文件会将我放在项目文件夹中。在这种情况下,似乎因为结构是在shell中运行的,所以控制权移交给了结构,所以我不能将bash的源内置到'$ source〜/ .virtualenv / myvenv / bin / activate'中。 有人举一个例子,并解释他们如何做到这一点吗?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.