OVERLAY_DIR = options.overlay_dir or '/usr/share/kernel-package'
- if options.source_only:
- logger.info('Lets build only sources')
-
# add current dir to python search path
cmd_folder = os.path.join(os.path.abspath(OVERLAY_DIR), '..')
sys.path.insert(0, cmd_folder)
logger.info('Running %s' % cmd)
os.system(cmd)
- if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR, [ 'kernel_debug', 'kernel_image' ]):
- exit(ERROR)
- if has_extra_modules():
- if not install_extra_modules():
- logger.error('Error during installation of extra kernel modules')
+ if options.source_only:
+ # only build source
+ logger.info('Lets build only sources')
+ if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR, [ 'kernel_source' ]):
exit(ERROR)
- if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR, [ 'modules' ]):
- exit(ERROR)
else:
- try:
- ftp = FTP(
- 'alexandria.profitbricks.localdomain',
- 'debian-uploader',
- 'vae6tooZe1ec'
- )
- except:
- logger.error('Cannot login via ftp...')
+ # build binaries and modules
+ if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR, [ 'kernel_debug', 'kernel_image' ]):
+ exit(ERROR)
+ if has_extra_modules():
+ if not install_extra_modules():
+ logger.error('Error during installation of extra kernel modules')
+ exit(ERROR)
+ if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR, [ 'modules' ]):
exit(ERROR)
- ftp.cwd('/srv/profitbricks-repository/incoming')
+ try:
+ ftp = FTP(
+ 'alexandria.profitbricks.localdomain',
+ 'debian-uploader',
+ 'vae6tooZe1ec'
+ )
+ except:
+ logger.error('Cannot login via ftp...')
+ exit(ERROR)
- logger.info('FTP Login on %s successful' %(ftp.host))
+ ftp.cwd('/srv/profitbricks-repository/incoming')
+
+ logger.info('FTP Login on %s successful' %(ftp.host))
+
+ if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'):
+ ftp.cwd('production-proposed-updates')
+ elif GIT_BRANCH_NAME.startswith('release/'):
+ ftp.cwd('staging');
+ else:
+ ftp.cwd('pre-staging');
+
+ for package in glob(
+ os.path.join(GIT_TARGET_WORKSPACE, '*.deb')
+ ):
+ fh = open(package, 'rb', 1)
+ ftp.storbinary(
+ 'STOR %s' %(os.path.basename(package)),
+ fh
+ )
+ fh.close()
+ logger.info('Successfully uploaded %s' %(package))
+ ftp.quit()
+ logger.info('Build successful')
+ logger.info('dirlist: %s' %(os.listdir(GIT_TARGET_WORKSPACE)))
- if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'):
- ftp.cwd('production-proposed-updates')
- elif GIT_BRANCH_NAME.startswith('release/'):
- ftp.cwd('staging');
- else:
- ftp.cwd('pre-staging');
-
- for package in glob(
- os.path.join(GIT_TARGET_WORKSPACE, '*.deb')
- ):
- fh = open(package, 'rb', 1)
- ftp.storbinary(
- 'STOR %s' %(os.path.basename(package)),
- fh
- )
- fh.close()
- logger.info('Successfully uploaded %s' %(package))
- ftp.quit()
- logger.info('Build successful')
- logger.info('dirlist: %s' %(os.listdir(GIT_TARGET_WORKSPACE)))
exit(OK)