else:
parallel_jobs = int(parallel_jobs)
- create_file('/etc/kernel-pkg.conf', 'maintainer := Profitbricks GmbH\nemail := %s\npriority := Low\ndebian = $(version)-%s' % (GIT_COMMITTER_EMAIL, revision))
cmd = [MAKE_KPKG, '-j', '%s' %(parallel_jobs), '--arch',
'%s' %(BUILD_ARCH), '--rootcmd', 'fakeroot',
'--append-to-version', '-%s' %(version),
- '--initrd', '--arch-in-name',
+ '--initrd', '--arch_in_name',
'kernel_image' ]
#'kernel_debug',
except:
raise
-def add_local_version_to_config(kernel_build_revision):
+def determine_kernel_flavour():
# don't put the branch names into the packages names
+ # instead just use the flavour part:
if GIT_BRANCH_NAME.startswith('master-'):
flavour = GIT_BRANCH_NAME[7:]
elif GIT_BRANCH_NAME.startswith('develop-'):
logger.error('GIT_BRANCH_NAME is %s, flavour is none.' % GIT_BRANCH_NAME)
flavour = 'none'
+ # slightly different version numbers per branch
+ if flavour in ('master', 'hotfix'):
+ debian_version = '$(version)-build%s' % REVISION
+ elif flavour == 'release':
+ debian_version = '$(version)~rc%s' % REVISION
+ else:
+ debian_version = '$(version)~develop%s' % REVISION
+
+ # create appropriate /etc/kernel-pkg.conf
+ content = 'maintainer := Profitbricks GmbH\nemail := %s\npriority := Low\ndebian = %s\n' % (GIT_COMMITTER_EMAIL, debian_version)
+ create_file('/etc/kernel-pkg.conf', content)
+ logger.info('/etc/kernel-pkg.conf created with this content: %s' % content)
+
+ # return safely
localversion = 'profitbricks-%s' % flavour
return localversion
if not git_checkout_branch():
exit(ERROR)
- new_version = REVISION
- kernel_version = add_local_version_to_config(new_version)
- logger.info('REVISION = %s, kernel_version = %s' %(REVISION,kernel_version))
+ kernel_flavour = determine_kernel_flavour()
+ logger.info('REVISION = %s, kernel_flavour = %s' %(REVISION,kernel_flavour))
logger.debug('changing dir to %s' %(GIT_TARGET_DIR))
os.chdir(GIT_TARGET_DIR)
logger.error('Error during installation of extra kernel modules')
exit(ERROR)
- if not build_kernel(kernel_version, new_version):
+ if not build_kernel(kernel_flavour, REVISION):
exit(ERROR)
else:
ftp = FTP(