Revision e4740989 fabfile.py

b/fabfile.py
44 44
env.autoremove = True
45 45
env.packages = ['snf-common', 'snf-app', 'snf-ganeti-tools', 'snf-webproject',
46 46
                'snf-okeanos-site']
47
env.deb_packages = ['snf-common', 'snf-app', 'snf-ganeti-tools', 'snf-webproject']
48 47
env.capture = False
49 48
env.colors = True
50 49
env.pypi_root = 'pypi'
......
62 61
def dev():
63 62
    env.develop = True
64 63

  
64

  
65 65
# wrap local to respect global capturing setting from env.capture
66 66
oldlocal = local
67 67
def local(cmd, capture="default"):
......
86 86
def build_pkg(p):
87 87
    info ("building package: %s" % p)
88 88
    with lcd(package_root(p)):
89
        with settings(warn_only=True):
90
            local("rm -r dist build")
89
        local("rm -r dist build")
91 90
        local("python setup.py egg_info -d sdist")
92 91

  
93 92

  
......
161 160
#
162 161

  
163 162
env.debian_branch = 'debian-0.8'
163
env.deb_packages = ['snf-common', 'snf-app', 'snf-ganeti-tools', 'snf-webproject']
164
env.signdebs = True
165

  
164 166

  
165 167
def _last_commit(f):
166 168
    return local("git rev-list --all --date-order --max-count=1 %s" % f,
167 169
            capture=True).strip()
168 170

  
171

  
169 172
def _diff_from_master(c,f):
170 173
    return local("git log --oneline %s..master %s" \
171 174
                 " | wc -l" % (c, f), capture=True)
172 175

  
176

  
173 177
def dch(p):
174 178
    with co(env.debian_branch):
175 179
        local("git merge master")
......
189 193

  
190 194
            local("rm -r .git")
191 195

  
196

  
197
def nosigndebs():
198
    env.signdebs = False
199

  
200

  
192 201
def builddeb(p, master="master", branch="debian-0.8"):
193
    with lcd(package_root(p)):
194
        local("git merge master")
195
        with settings(warn_only=True):
196
            local("ls .git || mkdir .git")
202
    with co(branch):
203
        with lcd(package_root(p)):
204
            local("git merge master")
205
            local("if [ ! -d .git ]; then mkdir .git; fi")
197 206
            local("python setup.py clean")
198 207
            local("git add synnefo/versions/*.py -f")
199
            local("git-buildpackage --git-upstream-branch=%s --git-debian-branch=%s \
200
--git-export=INDEX --git-ignore-new" % (master, branch))
208
            local(("git-buildpackage --git-upstream-branch=%s --git-debian-branch=%s"
209
                   " --git-export=INDEX --git-ignore-new %s") %
210
                   (master, branch, "" if env.signdebs else "-us -uc"))
201 211
            local("rm -rf .git")
202 212
            local("git reset synnefo/versions/*.py")
203 213

  
204 214

  
205 215
def builddeball(b="debian-0.8"):
206
    with co(b):
207
        for p in env.deb_packages:
208
            builddeb(p, b)
216
    for p in env.deb_packages:
217
        builddeb(p, b)
209 218
    collectdebs()
210 219

  
211 220

  

Also available in: Unified diff