Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YAML file in Fabric

Tags:

python

fabric

With regards to using Fabric, In "Tav's Blog" here: http://tav.espians.com/fabric-python-with-cleaner-api-and-parallel-deployment-support.html

I've read that Fabric can support YAML config files.

env.config_file = 'deploy.yaml'

You can then access the YAML data using the "env.config" variable like so:

def get_latest_commit():
    return urlopen(env.config.commits_server).read()


@task
    def deploy():
        with cd(env.config.app_directory):
        ...

For some reason I can't get this working.

Has anyone used this before? Can they give me a simple explanation or example of how to use these YAML configs in Fabric files?

like image 432
outrunthewolf Avatar asked Jul 15 '13 12:07

outrunthewolf


1 Answers

Tav's blog is a custom fork of Fabric that wasn't pulled into Mainline. It's currently become outdated as well.

The way you'd set these would be with a fabricrc file. This is talked about here:

http://docs.fabfile.org/en/1.7/usage/fab.html?highlight=fabricrc#settings-files

and here

http://docs.fabfile.org/en/1.7/usage/fabfiles.html?highlight=fabricrc

like image 50
Morgan Avatar answered Oct 15 '22 02:10

Morgan