From: Holger Levsen Date: Tue, 13 Mar 2012 14:44:11 +0000 (+0100) Subject: fix release branch support and drop support for branches called experimental X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=f673b3db26962330870913ae4c27e727de2ed00d;p=profitbricks%2Fjenkins-build-scripts.git fix release branch support and drop support for branches called experimental --- diff --git a/debian_build.py b/debian_build.py index 54d6b19..2985243 100755 --- a/debian_build.py +++ b/debian_build.py @@ -327,15 +327,13 @@ if __name__ == '__main__': # get the current commit id current_commit = git_helper.git_get_commit_id() - # FIXME: we should really only test for branch names here, not for distros - if options.distribution in ('testing', 'staging', 'unstable', 'pre-staging','experimental'): + if GIT_BRANCH_NAME == 'develop' or GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/') or GIT_BRANCH_NAME.startswith('release/'): daily_date = datetime.datetime.now().strftime('%Y%m%d%H%M%S') if GIT_BRANCH_NAME.startswith('release/'): + # use shorter date as we can daily_date = datetime.datetime.now().strftime('%Y%m%d') - - if GIT_BRANCH_NAME.startswith('release/'): version = '%s~rc%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit[0:7]) - elif GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/') or options.distribution == 'experimental': + elif GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/'): version = '%s~experimental%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit[0:7]) # these uploads should go to a different repo: DPUT_OPTIONS = DPUT_OPTIONS_DEV @@ -344,7 +342,7 @@ if __name__ == '__main__': new_log = 'Generated by jenkins build of %s' % current_commit - if GIT_BRANCH_NAME == 'experimental' or GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/'): + if GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/'): changelog_distro ='dev-'+ GIT_BRANCH_NAME.replace("/","-") else: changelog_distro = options.distribution @@ -396,7 +394,7 @@ if __name__ == '__main__': cmd = ['/usr/bin/git', 'commit', '-a', '-m', 'add new changelog entry'] subprocess.check_call(cmd) - if GIT_BRANCH_NAME == 'experimental' or GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/'): + if GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/'): pb_suite=changelog_distro elif GIT_BRANCH_NAME.startswith('hotfix/') or GIT_BRANCH_NAME.startswith('release/') or options.distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates'): pb_suite='production-proposed-updates'