Best way to add an environment variable in fabric?

后端 未结 5 1415
执笔经年
执笔经年 2020-12-29 01:38

I would like to pass a few values from fabric into the remote environment, and I\'m not seeing a great way to do it. The best I\'ve come up with so far is:

         


        
5条回答
  •  一整个雨季
    2020-12-29 02:16

    Fabric 1.5.0 (currently in Git) takes shell as local() named argument. If you pass '/bin/bash' there it passes it to executable argument of Popen.

    It won't execute your .bashrc though because .bashrc is sourced on interactive invocation of bash. You can source any file you want inside local:

    local('. /usr/local/bin/virtualenvwrapper.sh && workon focus_tests && bunch local output', shell='/bin/bash')
    

提交回复
热议问题