From eb4f3407160615a4184f57e7d24c3ac4efe92719 Mon Sep 17 00:00:00 2001 From: Mathias Klette Date: Tue, 30 Apr 2013 19:45:27 +0200 Subject: [PATCH] some more beautifying --- debian_build.py | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/debian_build.py b/debian_build.py index 04f119f..62b2f11 100755 --- a/debian_build.py +++ b/debian_build.py @@ -31,9 +31,6 @@ from ftplib import FTP from glob import glob from multiprocessing import cpu_count -# import libs from 3rd party packages -import psycopg2 - # import local modules from add_liveboot_request import add_liveboot_request from cidb import * @@ -46,11 +43,31 @@ from lib import git_helper # from common_code logger = logger_init() +# jenkins parameters +GIT_REPO_PATH = ENV['GIT_REPO_PATH'] +GIT_REPO_NAME = os.path.basename(ENV['GIT_REPO_PATH']) +GIT_BRANCH_NAME = ENV['GIT_BRANCH_NAME'] +GIT_COMMITTER_EMAIL = ENV['GIT_COMMITTER_EMAIL'] +ENV.setdefault('NO_UPLOAD','') +NO_UPLOAD = ENV['NO_UPLOAD'] + # local constants DEFAULT_PARALLEL_JOBS = cpu_count() + 1 JOB_URL = 'http://jenkins:80/job/%(flavour)s/buildWithParameters?token=BuildIt&' JOB_DELAY = '0sec' +AUTO_CHANGELOG_REPONAMES = ( + 'ri-docs', + 'so-docs', + 'infrastructure-docs', + 'storage-docs', + ) +STABLE_DISTRIBUTIONS = ( + 'stable', + 'production', + 'production-proposed-updates' + ) + #unused: (except in in-active code) GIT_TARGET_WORKSPACE = os.path.join( CWD, @@ -80,25 +97,6 @@ DPUT_OPTIONS_DEV = { } DPUT_CF = os.path.join(CWD, '..', 'dput.cf') -GIT_REPO_PATH = ENV['GIT_REPO_PATH'] -GIT_REPO_NAME = os.path.basename(ENV['GIT_REPO_PATH']) -GIT_BRANCH_NAME = ENV['GIT_BRANCH_NAME'] -GIT_COMMITTER_EMAIL = ENV['GIT_COMMITTER_EMAIL'] - -ENV.setdefault('NO_UPLOAD','') -NO_UPLOAD = ENV['NO_UPLOAD'] - -AUTO_CHANGELOG_JOBS = ( - 'ri-docs', - 'so-docs', - 'infrastructure-docs', - 'storage-docs', - ) -STABLE_DISTRIBUTIONS = ( - 'stable', - 'production', - 'production-proposed-updates' - ) class HudsonUrl(urllib.FancyURLopener): pass @@ -303,7 +301,7 @@ if __name__ == '__main__': else: logger.debug('Status is now:\n%s' %( gitcmd.status().strip() )) - if GIT_BRANCH_NAME == 'master' and BUILD_JOBNAME in AUTO_CHANGELOG_JOBS: + if GIT_BRANCH_NAME == 'master' and BUILD_JOBNAME in AUTO_CHANGELOG_REPONAMES: cmd = ['/usr/bin/dch', '-i', 'Released by jenkins.'] subprocess.check_call(cmd) cmd = ['/usr/bin/git-dch', '-R', '-a', '--spawn-editor=none'] -- 2.39.5