fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] setting variable value using local/subprocess


From: Shantanu Pavgi
Subject: [Fab-user] setting variable value using local/subprocess
Date: Mon, 22 Aug 2011 14:01:01 -0500

I am writing a task where output of local wrapper needs to be assigned to a 
variable so that it can be used later in another command. Following is a task 
where commit_sha1 is obtained from git command and then used in tar command: 

{{{
# Create project-commit-id.tar.gz for the project 
def make_tar():
        """Create tar.gz archive with latest commit id"""
        with lcd('%s/%s' %(env.builddir,env.projectrepo)):
                commit_sha1 = local('git log -1 --pretty=format:%H')
        with lcd('%s' %(env.builddir)):
                local('tar cvzf %s-%s.tar.gz %s' 
%(env.projectrepo,commit_sha1,env.projectrepo))
}}}

It seems like 'commit_sha1' variable is not getting set at all. I am using 
Fabric 1.2.0. 

Am I missing anything here? Any help?

--
Thanks,
Shantanu. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]