有困难理解如何做的事情,我认为应该是直觉与织物。我想捕获从远程执行的命令产生的stdout,然后在随后的远程调用中使用该结果。在
然而,我得到了真正无法理解的错误。我感觉到我所做的有很多问题,但我不知道从哪里开始。也许有人能帮我把这个分开。在
我所拥有的:
...
with cd(env.repo):
abbrev_hash = run('git log -1 --pretty="%h"')
run("rsync -r --exclude '.git/*' %s %s" % (env.repo, abbrev_hash))
...
相关输出:
[cookcountyjail.recoveredfactory.net] run: git log -1 --pretty="%h" [cookcountyjail.recoveredfactory.net] out: [cookcountyjail.recoveredfactory.net] out: c6d4ea0 [cookcountyjail.recoveredfactory.net] out: [cookcountyjail.recoveredfactory.net] out: [cookcountyjail.recoveredfactory.net] run: rsync -r --exclude '.git/*' > /home/ubuntu/repos/cookcoc6d4ea0l_2.0-dev
[cookcountyjail.recoveredfactory.net] out: /bin/bash: -c: line 1: syntax error near unexpected token
newline' [cookcountyjail.recoveredfactory.net] out: /bin/bash: -c: line 1:
[cookcountyjail.recoveredfactory.net] out: ' [cookcountyjail.recoveredfactory.net] out:Fatal error: run() received nonzero return code 1 while executing!
c6d4ea0ed: rsync -r --exclude '.git/*' /home/ubuntu/repos/cookcountyjail_2.0-dev
Executed: /bin/bash -l -c "cd /home/ubuntu/website/2.0/websites && export PATH=\"\$PATH:\"/home/ubuntu/website/2.0/websites/active\"\" && rsync -r --exclude '.git/*' /home/ubuntu/repos/cookcouc6d4ea0_2.0-dev "
这不是你想要的吗?在
http://docs.fabfile.org/en/1.8/api/core/operations.html#fabric.operations.run
在
local
文档中也有这样一个位:http://docs.fabfile.org/en/1.8/api/core/operations.html#fabric.operations.local
相关问题 更多 >
编程相关推荐