from lib import sbuild
-# from common_code
-logger = logger_init(re.match('^(.*/jenkins_build_script/)(.*)', __file__).groups()[1])
-
# jenkins environment - parameters
ENV.setdefault('NO_UPLOAD', '')
ENV.setdefault('BUILD_TRIGGERS', '')
#GIT_REPO_PATH = ENV['GIT_REPO_PATH']
# local constants
-BUILD_START = datetime.datetime.now()
-
SUPPORTED_DISTRIBUTIONS = ('squeeze', 'wheezy', 'jessie')
DISTRO_SUFFIX = {
return '"%s"' % arg.replace('\\', r'\\').replace('"', r'\"')
-if __name__ == '__main__':
+def main():
+ build_start = datetime.datetime.now()
+ logger = logger_init(re.match('^(.*/jenkins_build_script/)(.*)', __file__).groups()[1])
logger.debug('Start-up environment:\n\n{env}\n'.format(env=pformat(ENV)))
# Act I: prepare variables
logger.info('Repository Name: %s' % repo_name)
# .. some local variables
- daily_date = BUILD_START.strftime('%Y%m%d%H%M%S')
+ daily_date = build_start.strftime('%Y%m%d%H%M%S')
local_branch = re.match('^(origin/)?(.*)', ENV['GIT_BRANCH']).groups()[1]
remote_branch = os.path.join('origin', local_branch)
figlet('Legacy upload failed')
# .. define the time of completion
- BUILD_END = datetime.datetime.now()
+ build_end = datetime.datetime.now()
# .. and add all the records to CIDB
if not do_cidb:
ENV['BUILD_NUMBER'],
os.path.abspath(changes_file),
new_version,
- BUILD_START,
- BUILD_END,
+ build_start,
+ build_end,
git_repo_name,
ENV['GIT_URL'],
ENV['GIT_COMMIT']
logger.info('-' * 99)
figlet('Success!!!')
exit_ok()
+
+if __name__ == '__main__':
+ main()