From: Holger Levsen Date: Tue, 24 Jan 2012 16:44:24 +0000 (+0100) Subject: add support for uploading builds from feature etc branches to another repo X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=ec41529bc3f936d04c0445c98f6efe62271407c7;p=profitbricks%2Fjenkins-build-scripts.git add support for uploading builds from feature etc branches to another repo --- diff --git a/debian_build.py b/debian_build.py index ac0993e..409dbf8 100755 --- a/debian_build.py +++ b/debian_build.py @@ -64,7 +64,7 @@ GIT_TARGET_DIR = os.path.join( JOB_NAME = os.environ.get('JOB_NAME') GIT_COMMITTER_EMAIL = os.environ.get('GIT_COMMITTER_EMAIL') -DPUT_OPTIONS = { +DPUT_OPTIONS_DEFAULT = { 'fqdn': 'alexandria.profitbricks.localdomain', 'method': 'scp', 'login': 'reprepro', @@ -72,6 +72,14 @@ DPUT_OPTIONS = { 'allow_unsigned_uploads': 1, 'post_upload_command': 'ssh reprepro@alexandria.profitbricks.localdomain /srv/profitbricks-repository/bin/pb_processincoming', } +DPUT_OPTIONS_DEV = { + 'fqdn': 'alexandria.profitbricks.localdomain', + 'method': 'scp', + 'login': 'reprepro', + 'incoming': '/srv/profitbricks-dev-repository/incoming/profitbricks', + 'allow_unsigned_uploads': 1, + 'post_upload_command': 'ssh reprepro@alexandria.profitbricks.localdomain /srv/profitbricks-dev-repository/bin/pb_processincoming', + } DPUT_CF = os.path.join(GIT_TARGET_WORKSPACE, 'dput.cf') NO_UPLOAD = os.environ.get('NO_UPLOAD') @@ -339,13 +347,17 @@ if __name__ == '__main__': ) exit_error() - if options.distribution in ('testing', 'staging', 'unstable', 'pre-staging','experimental') or GIT_BRANCH_NAME.startswith('release') or GIT_BRANCH_NAME.startswith('hotfix'): + DPUT_OPTIONS = DPUT_OPTIONS_DEFAULT + + if options.distribution in ('testing', 'staging', 'unstable', 'pre-staging','experimental') or GIT_BRANCH_NAME.startswith('release/') or GIT_BRANCH_NAME.startswith('hotfix/'): daily_date = datetime.datetime.now().strftime('%Y%m%d%H%M%S') - if GIT_BRANCH_NAME.startswith('release') or GIT_BRANCH_NAME.startswith('hotfix'): + if GIT_BRANCH_NAME.startswith('release/') or GIT_BRANCH_NAME.startswith('hotfix/'): version = '%s~rc%s' %(version, daily_date) - elif options.distribution.startswith('feature') or options.distribution == 'experimental': + elif GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/') or options.distribution == 'experimental': version = '%s~alpha%s' %(version, daily_date) + # these uploads should go to a different repo: + DPUT_OPTIONS = DPUT_OPTIONS_DEV else: version = '%s~develop%s' %(version, daily_date) @@ -402,7 +414,7 @@ if __name__ == '__main__': pb_suite='experimental' elif options.distribution in ('unstable' , 'pre-staging'): pb_suite='pre-staging' - elif GIT_BRANCH_NAME.startswith('release') or GIT_BRANCH_NAME.startswith('hotfix') or options.distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates'): + elif GIT_BRANCH_NAME.startswith('release/') or GIT_BRANCH_NAME.startswith('hotfix/') or options.distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates'): pb_suite='production-proposed-updates' gbp = git_buildpackage.GitBuildPackage(