]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
some more beautifying
authorMathias Klette <mathias.klette@profitbricks.com>
Tue, 30 Apr 2013 17:45:27 +0000 (19:45 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Tue, 30 Apr 2013 17:45:27 +0000 (19:45 +0200)
debian_build.py

index 04f119f49cdf6fb5d1cdc4e05369d0c6176ae7e6..62b2f11741c0bf64ddda4db57dfada61c83df902 100755 (executable)
@@ -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']