1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2012 Canonical
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.
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
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
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-{}"
28
IGNORECHANGELOG_COMMIT = "#nochangelog"
30
PROJECT_CONFIG_SUFFIX = "project"
32
BOT_DEBFULLNAME = "Ubuntu daily release"
33
BOT_DEBEMAIL = "ps-jenkins@lists.canonical.com"
34
home_dir = "/srv/bsb_worker"
37
if not os.path.isdir(os.path.join(GNUPG_DIR, '.gnupg')):
39
CRED_FILE_PATH = os.path.join(CU2D_DIR, "launchpad.credentials")
41
# TODO refactor into a ci-utils module
43
path = os.path.join(home_dir, '../unit_config')
47
config = yaml.safe_load(f.read())
49
print('Unable to use unit_config(%s), defaulting values' % path)
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/')
60
if not os.path.exists(CRED_FILE_PATH):
61
with open(CRED_FILE_PATH, 'w') as f:
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)
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)
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"
80
TIME_BETWEEN_PPA_CHECKS = 60
81
TIME_BETWEEN_STACK_CHECKS = 60
82
TIME_BEFORE_STOP_LOOKING_FOR_SOURCE_PUBLISH = 20 * 60
84
PUBLISHER_ARTEFACTS_FILENAME = 'publisher.xml'
85
PREPARE_ARTEFACTS_FILENAME_FORMAT = 'prepare_{}.xml'
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)
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"
98
STACK_RUNNING_DIR = "/iSCSI/jenkins/cu2d/work"
99
STACK_STATUS_PUBLISHING_DIR = "/iSCSI/jenkins/cu2d/result_publishing"
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)