Skip to content

Commit

Permalink
Builder|Fixed: Sign and publish the latest build, not today's
Browse files Browse the repository at this point in the history
These changes allow the day to change during a build; the steps
following the initial tagging now operate on the latest available
build rather than today's build.
  • Loading branch information
skyjake committed Apr 3, 2013
1 parent cade303 commit e18bbcf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
16 changes: 12 additions & 4 deletions distrib/autobuild.py
Expand Up @@ -87,15 +87,22 @@ def todays_platform_release():


def sign_packages():
"""Sign all packages in today's build."""
ev = builder.Event()
print "Signing today's build %i." % ev.number()
"""Sign all packages in the latest build."""
ev = builder.Event(latestAvailable=True)
print "Signing build %i." % ev.number()
for fn in os.listdir(ev.path()):
if fn.endswith('.exe') or fn.endswith('.dmg') or fn.endswith('.deb'):
# Make a signature for this.
os.system("gpg --output %s -ba %s" % (ev.file_path(fn) + '.sig', ev.file_path(fn)))


def publish_packages():
"""Publish all packages to SourceForge."""
ev = builder.Event(latestAvailable=True)
print "Publishing build %i." % ev.number()
system_command('deng_copy_build_to_sourceforge.sh "%s"' % ev.path())


def find_previous_tag(toTag, version):
builds = builder.events_by_time()
#print [(e[1].number(), e[1].timestamp()) for e in builds]
Expand Down Expand Up @@ -348,7 +355,7 @@ def generate_wiki():
import dew
dew.login()
# Today's event data.
ev = builder.Event()
ev = builder.Event(latestAvailable=True)
if ev.release_type() == 'stable':
dew.submitPage('Latest Doomsday release',
'#REDIRECT [[Doomsday version %s]]' % ev.version())
Expand Down Expand Up @@ -437,6 +444,7 @@ def sorted_commands():
'create': create_build_event,
'platform_release': todays_platform_release,
'sign': sign_packages,
'publish': publish_packages,
'changes': update_changes,
'debchanges': update_debian_changelog,
'apt': rebuild_apt_repository,
Expand Down
9 changes: 8 additions & 1 deletion distrib/builder/event.py
Expand Up @@ -11,9 +11,16 @@ class Event:
"""Build event. Manages the contents of a single build directory under
the event directory."""

def __init__(self, build=None):
def __init__(self, build=None, latestAvailable=False):
"""Any .txt logs present in the build directory are compressed into
a combined .txt.gz (one per package)."""

if latestAvailable:
# Look for the latest build.
build = int(build_number.todays_build())
while not os.path.exists(os.path.join(config.EVENT_DIR, 'build%i' % build)):
build -= 1
if build == 0: raise Exception("No builds available")

if build is None:
# Use today's build number.
Expand Down
7 changes: 7 additions & 0 deletions distrib/builder/utils.py
@@ -1,4 +1,5 @@
import os, sys, platform
import subprocess
import string
import glob
import gzip
Expand Down Expand Up @@ -152,3 +153,9 @@ def count_word(word, inText):
count += 1
pos += len(word)
return count


def system_command(cmd):
result = subprocess.call(cmd, shell=True)
if result != 0:
raise Exception("Error from " + cmd)
2 changes: 1 addition & 1 deletion distrib/pilot.py
Expand Up @@ -328,7 +328,7 @@ def doTask(task):

elif task == 'publish':
msg("PUBLISH")
systemCommand('deng_copy_build_to_sourceforge.sh')
return autobuild("publish")

elif task == 'apt_refresh':
msg("APT REPOSITORY REFRESH")
Expand Down

0 comments on commit e18bbcf

Please sign in to comment.