~ursinha/ubuntu-ci-services-itself/401-copying-di-check

« back to all changes in this revision

Viewing changes to branch-source-builder/cupstream2distro/settings.py

  • Committer: francis.ginther@canonical.com
  • Date: 2014-01-31 17:06:36 UTC
  • mto: This revision was merged to the branch mainline in revision 233.
  • Revision ID: francis.ginther@canonical.com-20140131170636-iwe5o3046phdydo3
Adds dput and ppa watch functionality to the branch source builder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# Copyright (C) 2012 Canonical
 
3
#
 
4
# Authors:
 
5
#  Didier Roche
 
6
#
 
7
# This program is free software; you can redistribute it and/or modify it under
 
8
# the terms of the GNU General Public License as published by the Free Software
 
9
# Foundation; version 3.
 
10
#
 
11
# This program is distributed in the hope that it will be useful, but WITHOUT
 
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
13
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
14
# details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License along with
 
17
# this program; if not, write to the Free Software Foundation, Inc.,
 
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
19
 
 
20
import os
 
21
 
 
22
REV_STRING_FORMAT = "Automatic snapshot from revision"
 
23
NEW_CHANGELOG_PATTERN = "^{} \(.*\) (?!UNRELEASED)"
 
24
PACKAGING_MERGE_COMMIT_MESSAGE = "Releasing {} (revision {} from {})"
 
25
REPLACEME_TAG = "0replaceme"
 
26
BRANCH_URL = "lp:~ps-jenkins/{}/latestsnapshot-{}"
 
27
 
 
28
IGNORECHANGELOG_COMMIT = "#nochangelog"
 
29
 
 
30
PROJECT_CONFIG_SUFFIX = "project"
 
31
 
 
32
BOT_DEBFULLNAME = "Ubuntu daily release"
 
33
BOT_DEBEMAIL = "ps-jenkins@lists.canonical.com"
 
34
home_dir = "/srv/bsb_worker"
 
35
CU2D_DIR = home_dir
 
36
GNUPG_DIR = CU2D_DIR
 
37
if not os.path.isdir(os.path.join(GNUPG_DIR, '.gnupg')):
 
38
    GNUPG_DIR = home_dir
 
39
CRED_FILE_PATH = os.path.join(CU2D_DIR, "launchpad.credentials")
 
40
 
 
41
# TODO refactor into a ci-utils module
 
42
def _unit_config():
 
43
    path = os.path.join(home_dir, '../unit_config')
 
44
    config = {}
 
45
    try:
 
46
        with open(path) as f:
 
47
            config = yaml.safe_load(f.read())
 
48
    except:
 
49
        print('Unable to use unit_config(%s), defaulting values' % path)
 
50
    return config
 
51
_cfg = _unit_config()
 
52
LAUNCHPAD_PPA_USER = _cfg.get('launchpad_user', None)
 
53
LAUNCHPAD_API_BASE = _cfg.get(
 
54
    'launchpad_api_base', 'https://api.launchpad.net/1.0')
 
55
OAUTH_CONSUMER_KEY = _cfg.get('oauth_consumer_key', None)
 
56
OAUTH_TOKEN = _cfg.get('oauth_token', None)
 
57
OAUTH_TOKEN_SECRET = _cfg.get('oauth_token_secret', None)
 
58
OAUTH_REALM = _cfg.get('oauth_realm', 'https://api.launchpad.net/')
 
59
 
 
60
if not os.path.exists(CRED_FILE_PATH):
 
61
    with open(CRED_FILE_PATH, 'w') as f:
 
62
        f.write('[1]\n')
 
63
        f.write('consumer_key = %s\n' % OAUTH_CONSUMER_KEY)
 
64
        f.write('consumer_secret = \n')
 
65
        f.write('access_token = %s\n' % OAUTH_TOKEN)
 
66
        f.write('access_secret = %s\n' % OAUTH_TOKEN_SECRET)
 
67
 
 
68
COMMON_LAUNCHPAD_CACHE_DIR = os.path.join("/tmp", "launchpad.cache")
 
69
if not os.path.isdir(COMMON_LAUNCHPAD_CACHE_DIR):
 
70
    os.makedirs(COMMON_LAUNCHPAD_CACHE_DIR)
 
71
BOT_KEY = "B879A3E9"
 
72
 
 
73
# selected arch for building arch:all packages
 
74
VIRTUALIZED_PPA_ARCH = ["i386", "amd64"]
 
75
# an arch we will ignore for publication if latest published version in dest doesn't build it
 
76
ARCHS_TO_EVENTUALLY_IGNORE = set(['powerpc', 'arm64', 'ppc64el'])
 
77
ARCHS_TO_UNCONDITIONALLY_IGNORE = set(['arm64', 'ppc64el'])
 
78
SRU_PPA = "ubuntu-unity/sru-staging"
 
79
 
 
80
TIME_BETWEEN_PPA_CHECKS = 60
 
81
TIME_BETWEEN_STACK_CHECKS = 60
 
82
TIME_BEFORE_STOP_LOOKING_FOR_SOURCE_PUBLISH = 20 * 60
 
83
 
 
84
PUBLISHER_ARTEFACTS_FILENAME = 'publisher.xml'
 
85
PREPARE_ARTEFACTS_FILENAME_FORMAT = 'prepare_{}.xml'
 
86
 
 
87
OLD_STACK_DIR = 'old'
 
88
PACKAGE_LIST_RSYNC_FILENAME_PREFIX = 'packagelist_rsync'
 
89
PACKAGE_LIST_RSYNC_FILENAME_FORMAT = PACKAGE_LIST_RSYNC_FILENAME_PREFIX + '_{}-{}'
 
90
RSYNC_PATTERN = "rsync://RSYNCSVR/cu2d_out/{}*".format(PACKAGE_LIST_RSYNC_FILENAME_PREFIX)
 
91
 
 
92
ROOT_CU2D = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
 
93
DEFAULT_CONFIG_STACKS_DIR = os.path.join(os.path.dirname(ROOT_CU2D), 'cupstream2distro-config', 'stacks')
 
94
STACK_STATUS_FILENAME = "stack.status"
 
95
STACK_STARTED_FILENAME = "stack.started"
 
96
STACK_BUILDING_FILENAME = "stack.building"
 
97
 
 
98
STACK_RUNNING_DIR = "/iSCSI/jenkins/cu2d/work"
 
99
STACK_STATUS_PUBLISHING_DIR = "/iSCSI/jenkins/cu2d/result_publishing"
 
100
 
 
101
# for citrain
 
102
SILO_NAME_LIST = []
 
103
for i in xrange(1, 11):
 
104
    SILO_NAME_LIST.append("landing-{:03d}".format(i))
 
105
SILO_CONFIG_FILENAME = "config"
 
106
SILO_BUILDPPA_SCHEME = "ci-train-ppa-service/{}"
 
107
SILO_PACKAGING_RELEASE_COMMIT_MESSAGE = "Releasing {}"
 
108
SILOS_RAW_DIR = "~/silos"
 
109
SILOS_DIR = os.path.expanduser(SILOS_RAW_DIR)
 
110
SILO_RSYNCDIR = "~/out"
 
111
SILO_STATUS_RSYNCDIR = os.path.expanduser("~/status")
 
112
CITRAIN_BINDIR = "~/citrain/citrain"
 
113
(SILO_EMPTY, SILO_BUILTCHECKED, SILO_PUBLISHED, SILO_DONE) = range(4)
 
114
 
 
115
SERIES_VERSION = {
 
116
    'precise': '12.04',
 
117
    'raring': '13.04',
 
118
    'saucy': '13.10',
 
119
    'trusty': '14.04'
 
120
}