Best way to add an environment variable in fabric?

后端 未结 5 1413
执笔经年
执笔经年 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:31

    As of fabric 1.5 (released), fabric.context_managers.shell_env does what you want.

        with shell_env(FOO1='BAR1', FOO2='BAR2', FOO3='BAR3'):
            local("echo FOO1 is $FOO1")
    

提交回复
热议问题