本文整理汇总了Python中release.info.readReleaseConfig函数的典型用法代码示例。如果您正苦于以下问题:Python readReleaseConfig函数的具体用法?Python readReleaseConfig怎么用?Python readReleaseConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了readReleaseConfig函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: validate
def validate(options, args):
err = False
config = {}
if not options.configfile:
log.info("Must pass --configfile")
sys.exit(1)
elif not path.exists(path.join('buildbot-configs', options.configfile)):
log.info("%s does not exist!" % options.configfile)
sys.exit(1)
config = readReleaseConfig(path.join('buildbot-configs', options.configfile))
for key in REQUIRED_CONFIG:
if key not in config:
err = True
log.info("Required item missing in config: %s" % key)
for r in config['sourceRepositories'].values():
for key in REQUIRED_SOURCE_REPO_KEYS:
if key not in r:
err = True
log.info("Missing required key '%s' for '%s'" % (key, r))
if 'otherReposToTag' in config:
if not callable(getattr(config['otherReposToTag'], 'iteritems')):
err = True
log.info("otherReposToTag exists in config but is not a dict")
if err:
sys.exit(1)
return config
开发者ID:EkkiD,项目名称:build-tools,代码行数:29,代码来源:tag-release.py
示例2: validate
def validate(options, args):
if not options.configfile:
log.info("Must pass --configfile")
sys.exit(1)
releaseConfigFile = "/".join(["buildbot-configs", options.releaseConfig])
if options.chunks or options.thisChunk:
assert options.chunks and options.thisChunk, \
"chunks and this-chunk are required when one is passed"
assert not options.locales, \
"locale option cannot be used when chunking"
else:
if len(options.locales) < 1:
raise Exception('Need at least one locale to repack')
if options.balrog_api_root:
if not options.credentials_file or not options.balrog_username:
raise Exception("--credentials-file and --balrog-username must be set when --balrog-api-root is set.")
releaseConfig = readReleaseConfig(releaseConfigFile,
required=REQUIRED_RELEASE_CONFIG)
branchConfig = {
'stage_ssh_key': options.stage_ssh_key,
'hghost': options.hghost,
'stage_server': options.stage_server,
'stage_username': options.stage_username,
'ftp_server': options.ftp_server,
'compare_locales_repo_path': options.compare_locales_repo_path,
'bucket_prefix': options.bucket_prefix,
}
return branchConfig, releaseConfig
开发者ID:pocmo,项目名称:build-tools,代码行数:31,代码来源:create-release-repacks.py
示例3: bumpReleaseconfig
def bumpReleaseconfig(releaseConfigFile, options):
processVars = ['buildNumber', ]
build1BumpVars = ['version', 'baseTag', 'nextAppVersion', 'nextMilestone']
build1ProcessVars = ['oldVersion', 'oldBuildNumber', 'oldBaseTag']
oldReleaseConfig = readReleaseConfig(releaseConfigFile)
newReleaseConfig = copy.copy(oldReleaseConfig)
dictVars = {}
if options.bumpVersion:
newReleaseConfig['buildNumber'] = 1
for param in build1BumpVars:
newReleaseConfig[param] = increment(oldReleaseConfig[param])
if not options.preserve_relbranch:
dictVars['relbranch'] = None
newReleaseConfig['oldVersion'] = oldReleaseConfig['version']
newReleaseConfig['oldBuildNumber'] = oldReleaseConfig['buildNumber']
newReleaseConfig['oldBaseTag'] = oldReleaseConfig['baseTag']
processVars.extend(build1ProcessVars + build1BumpVars)
else:
newReleaseConfig['buildNumber'] = oldReleaseConfig['buildNumber'] + 1
if newReleaseConfig['buildNumber'] == 2:
if not options.relbranch:
print "Error: relbranch is required for build2!"
sys.exit(2)
else:
dictVars['relbranch'] = options.relbranch
if not options.revision:
print "Error: revision is required!"
sys.exit(3)
else:
dictVars['revision'] = options.revision
processFile(releaseConfigFile, processVars, dictVars, newReleaseConfig)
开发者ID:B-Rich,项目名称:build-tools,代码行数:35,代码来源:release_config_bumper.py
示例4: validate
def validate(options, args):
if not options.configfile:
log.info("Must pass --configfile")
sys.exit(1)
releaseConfigFile = "/".join(["buildbot-configs", options.releaseConfig])
if options.chunks or options.thisChunk:
assert options.chunks and options.thisChunk, \
"chunks and this-chunk are required when one is passed"
assert not options.locales, \
"locale option cannot be used when chunking"
else:
if len(options.locales) < 1:
raise Exception('Need at least one locale to repack')
releaseConfig = readReleaseConfig(releaseConfigFile,
required=REQUIRED_RELEASE_CONFIG)
branchConfig = {
'stage_ssh_key': options.stage_ssh_key,
'hghost': options.hghost,
'stage_server': options.stage_server,
'stage_username': options.stage_username,
'compare_locales_repo_path': options.compare_locales_repo_path,
}
return branchConfig, releaseConfig
开发者ID:bdacode,项目名称:build-tools,代码行数:25,代码来源:create-release-repacks.py
示例5: sendMailRD
def sendMailRD(smtpServer, From, cfgFile, r):
# Send an email to the mailing after the build
contentMail = ""
release_config = readReleaseConfig(cfgFile)
sources = release_config['sourceRepositories']
To = release_config['ImportantRecipients']
comment = r.get("comment")
if comment:
contentMail += "Comment:\n" + comment + "\n\n"
contentMail += "A new build has been submitted through ship-it:\n"
for name, source in sources.items():
# We cannot use the source["revision"] value because it has not been
# updated yet. It is done later in the process.
# Select the one defined
if name == "comm":
# Thunderbird
revision = r["commRevision"]
else:
revision = r["mozillaRevision"]
# For now, firefox has only one source repo but Thunderbird has two
contentMail += name + " commit: https://hg.mozilla.org/" + source['path'] + "/rev/" + revision + "\n"
contentMail += "\nCreated by " + r["submitter"] + "\n"
contentMail += "\nStarted by " + r["starter"] + "\n"
Subject = 'Build of %s' % r["name"]
sendmail(from_=From, to=To, subject=Subject, body=contentMail,
smtp_server=smtpServer)
开发者ID:petemoore,项目名称:build-tools,代码行数:35,代码来源:release-runner.py
示例6: validate
def validate(options, args):
if not options.configfile:
log.info("Must pass --configfile")
sys.exit(1)
releaseConfigFile = path.join("buildbot-configs", options.releaseConfig)
branchConfigFile = path.join("buildbot-configs", options.configfile)
branchConfigDir = path.dirname(branchConfigFile)
if not path.exists(branchConfigFile):
log.info("%s does not exist!" % branchConfigFile)
sys.exit(1)
if options.chunks or options.thisChunk:
assert options.chunks and options.thisChunk, \
"chunks and this-chunk are required when one is passed"
assert not options.locales, \
"locale option cannot be used when chunking"
else:
if len(options.locales) < 1:
raise Exception('Need at least one locale to repack')
releaseConfig = readReleaseConfig(releaseConfigFile,
required=REQUIRED_RELEASE_CONFIG)
sourceRepoName = releaseConfig['sourceRepositories'][options.source_repo_key]['name']
branchConfig = readBranchConfig(branchConfigDir, branchConfigFile,
sourceRepoName,
required=REQUIRED_BRANCH_CONFIG)
return branchConfig, releaseConfig
开发者ID:mjessome,项目名称:tools,代码行数:28,代码来源:create-release-repacks.py
示例7: validate
def validate(options, args):
assert options.chunks and options.thisChunk, \
"chunks and this-chunk are required"
releaseConfigFile = path.join("buildbot-configs", options.releaseConfig)
releaseConfig = readReleaseConfig(releaseConfigFile,
required=(options.configDict,))
uvConfig = path.join(UPDATE_VERIFY_DIR,
releaseConfig[options.configDict][options.release_channel]["verifyConfigs"][options.platform])
assert path.isfile(uvConfig), "Update verify config must exist!"
return releaseConfig
开发者ID:Callek,项目名称:build-tools,代码行数:11,代码来源:chunked-verify.py
示例8: extract_config_info
def extract_config_info(release_config_url):
""" Grab the contents of release configs to construct a URL to
shipped_locales """
log.info("Grabbing release configs from %s", release_config_url)
try:
subprocess.check_call(['wget',
'-O', './release_config.py',
release_config_url])
except subprocess.CalledProcessError:
log.fatal("error grabbing release configs")
raise
log.info("Attempting to import release_config.py...")
return readReleaseConfig('release_config.py')
开发者ID:EkkiD,项目名称:build-tools,代码行数:13,代码来源:download_builds.py
示例9: bump_configs
def bump_configs(release, cfgFile, l10nContents, workdir,
hg_username, productionBranch, defaultBranch='default'):
# Update the production branch first, because that's where we want to read
# the templates from
update(workdir, productionBranch)
cfgDir = path.join(workdir, 'mozilla')
templateFile = path.join(cfgDir, '%s.template' % cfgFile)
tags = set(getTags(getBaseTag(release['product'], release['version']),
release['buildNumber']))
cfgFile = path.join(cfgDir, cfgFile)
l10nChangesetsFile = path.join(
cfgDir,
readReleaseConfig(cfgFile)['l10nRevisionFile']
)
subs = release.copy()
if 'partials' in release:
subs['partials'] = getPartials(release)
# This is true 99% of the time. It's exceedingly rare that we ship a point
# release that we first push to the beta channel. If we need to, the
# expectation is that this will be ignored by hardcoding True in the
# template.
if isFinalRelease(release["version"]):
subs["betaChannelEnabled"] = True
else:
subs["betaChannelEnabled"] = False
with open(templateFile) as f:
template = f.read()
releaseConfig = substituteReleaseConfig(template, **subs)
# Write out the new configs on the production branch...
with open(cfgFile, 'w') as f:
f.write(releaseConfig)
with open(l10nChangesetsFile, 'w') as f:
f.write(l10nContents)
prodRev = commit(workdir, 'Update release config for %s' % release['name'],
user=hg_username)
# We always force tagging, because it makes it easier to retrigger a
# release that fails for infrastructure reasons.
tag(workdir, tags, rev=prodRev, force=True, user=hg_username)
# And then write the same files to the default branch
update(workdir, defaultBranch)
with open(cfgFile, 'w') as f:
f.write(releaseConfig)
with open(l10nChangesetsFile, 'w') as f:
f.write(l10nContents)
commit(workdir, 'Update release config for %s' % release['name'],
user=hg_username)
开发者ID:Callek,项目名称:build-tools,代码行数:48,代码来源:release-runner.py
示例10: validate
def validate(options, args):
if not options.configfile:
log.info("Must pass --configfile")
sys.exit(1)
releaseConfigFile = path.join("buildbot-configs", options.releaseConfig)
branchConfigFile = path.join("buildbot-configs", options.configfile)
branchConfigDir = path.dirname(branchConfigFile)
if not path.exists(branchConfigFile):
log.info("%s does not exist!" % branchConfigFile)
sys.exit(1)
releaseConfig = readReleaseConfig(releaseConfigFile, required=REQUIRED_RELEASE_CONFIG)
sourceRepoName = releaseConfig["sourceRepositories"][options.sourceRepoKey]["name"]
branchConfig = readBranchConfig(branchConfigDir, branchConfigFile, sourceRepoName, required=REQUIRED_BRANCH_CONFIG)
return branchConfig, releaseConfig
开发者ID:EkkiD,项目名称:build-tools,代码行数:16,代码来源:generate-sums.py
示例11: validate
def validate(options):
err = False
config = {}
if not path.exists(path.join("buildbot-configs", options.release_config)):
print "%s does not exist!" % options.release_config
sys.exit(1)
config = readReleaseConfig(path.join("buildbot-configs", options.release_config))
for key in REQUIRED_CONFIG:
if key not in config:
err = True
print "Required item missing in config: %s" % key
if err:
sys.exit(1)
return config
开发者ID:B-Rich,项目名称:build-tools,代码行数:17,代码来源:balrog-release-pusher.py
示例12: bump_configs
def bump_configs(server, username, sshKey, repo, repoPath, configsToBump,
configsToOverride):
reponame = get_repo_name(repo)
repo_url = make_hg_url(server, '%s/%s' % (repoPath, reponame))
pushRepo = make_hg_url(server, '%s/%s' % (repoPath, reponame),
protocol='ssh')
retry(mercurial, args=(repo_url, reponame))
def bump(repo, configsToBump, configsToOverride):
"""Process dynamic (version, buildNumber, etc.) variables in
configsToBump, then append overrides files to both configsToBump and
configsToOverride."""
# First pass. Bump variables in configsToBump.
configs = ['%s/%s' % (repo, x) for x in configsToBump.keys()]
cmd = ['python', BUMP_SCRIPT, '--bump-version', '--revision=tip']
cmd.extend(configs)
run_cmd(cmd)
# Second pass. Append override files to configsToBump and
# configsToOverride.
for config, overrides in \
configsToBump.items() + configsToOverride.items():
newContent = cat([path.join(repo, config)] +
[path.join(repo, x) for x in overrides])
fh = open(path.join(repo, config), 'wb')
fh.write(newContent)
fh.close()
run_cmd(['hg', 'commit', '-m', 'Automatic config bump'],
cwd=repo)
def bump_wrapper(r, n):
bump(r, configsToBump, configsToOverride)
def cleanup_wrapper():
cleanOutgoingRevs(reponame, pushRepo, username, sshKey)
retry(apply_and_push, cleanup=cleanup_wrapper,
args=(reponame, pushRepo, bump_wrapper),
kwargs=dict(ssh_username=username, ssh_key=sshKey))
tags = []
for configfile in configsToBump.keys():
config = readReleaseConfig(path.join(reponame, configfile))
tags.extend(getTags(config['baseTag'], config['buildNumber'],
buildTag=True))
return tags
开发者ID:EkkiD,项目名称:build-tools,代码行数:45,代码来源:repo_setup.py
示例13: sendMailRD
def sendMailRD(smtpServer, From, cfgFile, r):
# Send an email to the mailing after the build
contentMail = ""
release_config = readReleaseConfig(cfgFile)
sources = release_config['sourceRepositories']
To = release_config['ImportantRecipients']
comment = r.get("comment")
if comment:
contentMail += "Comment:\n" + comment + "\n\n"
contentMail += "A new build has been submitted through ship-it:\n"
for name, source in sources.items():
if name == "comm":
# Thunderbird
revision = source["revision"]
path = source["path"]
else:
revision = source["revision"]
path = source["path"]
# For now, firefox has only one source repo but Thunderbird has two
contentMail += name + " commit: https://hg.mozilla.org/" + path + "/rev/" + revision + "\n"
contentMail += "\nCreated by " + r["submitter"] + "\n"
contentMail += "\nStarted by " + r["starter"] + "\n"
subjectPrefix = ""
# On r-d, we prefix the subject of the email in order to simplify filtering
# We don't do it for thunderbird
if "Fennec" in r["name"]:
subjectPrefix = "[mobile] "
if "Firefox" in r["name"]:
subjectPrefix = "[desktop] "
Subject = subjectPrefix + 'Build of %s' % r["name"]
sendmail(from_=From, to=To, subject=Subject, body=contentMail,
smtp_server=smtpServer)
开发者ID:Callek,项目名称:build-tools,代码行数:43,代码来源:release-runner.py
示例14: validate
def validate(options):
err = False
config = {}
if not path.exists(path.join('buildbot-configs', options.release_config)):
log.error("%s does not exist!" % options.release_config)
exit(1)
config = readReleaseConfig(path.join('buildbot-configs',
options.release_config))
for key in REQUIRED_CONFIG:
if key not in config:
err = True
log.error("Required item missing in config: %s" % key)
if err:
exit(1)
return config
开发者ID:MaxMillion,项目名称:build-tools,代码行数:19,代码来源:create-update-verify-configs.py
示例15: bump_configs
def bump_configs(release, cfgFile, l10nContents, workdir,
hg_username, productionBranch, defaultBranch='default'):
# Update the production branch first, because that's where we want to read
# the templates from
update(workdir, productionBranch)
cfgDir = path.join(workdir, 'mozilla')
templateFile = path.join(cfgDir, '%s.template' % cfgFile)
tags = getTags(getBaseTag(release['product'], release['version']),
release['buildNumber'])
cfgFile = path.join(cfgDir, cfgFile)
l10nChangesetsFile = path.join(
cfgDir,
readReleaseConfig(cfgFile)['l10nRevisionFile']
)
subs = release.copy()
if 'partials' in release:
subs['partials'] = getPartials(release)
with open(templateFile) as f:
template = f.read()
releaseConfig = substituteReleaseConfig(template, **subs)
# Write out the new configs on the production branch...
with open(cfgFile, 'w') as f:
f.write(releaseConfig)
with open(l10nChangesetsFile, 'w') as f:
f.write(l10nContents)
prodRev = commit(workdir, 'Update release config for %s' % release['name'],
user=hg_username)
# We always force tagging, because it makes it easier to retrigger a
# release that fails for infrastructure reasons.
tag(workdir, tags, rev=prodRev, force=True, user=hg_username)
# And then write the same files to the default branch
update(workdir, defaultBranch)
with open(cfgFile, 'w') as f:
f.write(releaseConfig)
with open(l10nChangesetsFile, 'w') as f:
f.write(l10nContents)
commit(workdir, 'Update release config for %s' % release['name'],
user=hg_username)
开发者ID:magnyld,项目名称:build-tools,代码行数:40,代码来源:release-runner.py
示例16: validate
def validate(options, args):
err = False
config = {}
if not options.configfile:
log.info("Must pass --configfile")
sys.exit(1)
elif not path.exists(path.join('buildbot-configs', options.configfile)):
log.info("%s does not exist!" % options.configfile)
sys.exit(1)
config = readReleaseConfig(
path.join('buildbot-configs', options.configfile))
for key in REQUIRED_CONFIG:
if key not in config:
err = True
log.info("Required item missing in config: %s" % key)
for r in config['sourceRepositories'].values():
for key in REQUIRED_SOURCE_REPO_KEYS:
if key not in r:
err = True
log.info("Missing required key '%s' for '%s'" % (key, r))
if 'otherReposToTag' in config:
if not callable(getattr(config['otherReposToTag'], 'iteritems')):
err = True
log.info("otherReposToTag exists in config but is not a dict")
if err:
sys.exit(1)
# Non-fatal warnings only after this point
if not (options.tag_source or options.tag_l10n or options.tag_other):
log.info("No tag directive specified, defaulting to all")
options.tag_source = True
options.tag_l10n = True
options.tag_other = True
return config
开发者ID:SergiosLen,项目名称:browser-f,代码行数:38,代码来源:tag-release.py
示例17: validate
def validate(options, args):
if not options.configfile:
log.info("Must pass --configfile")
sys.exit(1)
releaseConfigFile = path.join("buildbot-configs", options.releaseConfig)
if options.chunks or options.thisChunk:
assert options.chunks and options.thisChunk, "chunks and this-chunk are required when one is passed"
assert not options.locales, "locale option cannot be used when chunking"
else:
if len(options.locales) < 1:
raise Exception("Need at least one locale to repack")
releaseConfig = readReleaseConfig(releaseConfigFile, required=REQUIRED_RELEASE_CONFIG)
sourceRepoName = releaseConfig["sourceRepositories"][options.source_repo_key]["name"]
branchConfig = {
"stage_ssh_key": options.stage_ssh_key,
"hghost": options.hghost,
"stage_server": options.stage_server,
"stage_username": options.stage_username,
"compare_locales_repo_path": options.compare_locales_repo_path,
}
return branchConfig, releaseConfig
开发者ID:smillaedler,项目名称:build-tools,代码行数:23,代码来源:create-release-repacks.py
示例18: mercurial
DEFAULT_BUILDBOT_CONFIGS_REPO))
parser.add_argument("-t", "--release-tag", required=True)
parser.add_argument("--product", help="Override for stage_product")
parser.add_argument("--ssh-user", required=True)
parser.add_argument("--ssh-key", required=True)
parser.add_argument("--overwrite", default=False, action="store_true")
parser.add_argument("--extra-excludes", action="append")
parser.add_argument("actions", nargs="+", help="Script actions")
args = parser.parse_args()
actions = args.actions
mercurial(args.buildbot_configs, "buildbot-configs")
update("buildbot-configs", revision=args.release_tag)
releaseConfigFile = path.join("buildbot-configs", args.release_config)
releaseConfig = readReleaseConfig(
releaseConfigFile, required=REQUIRED_RELEASE_CONFIG)
productName = args.product or releaseConfig['stage_product']
version = releaseConfig['version']
buildNumber = releaseConfig['buildNumber']
stageServer = releaseConfig['stagingServer']
stageUsername = args.ssh_user
stageSshKey = args.ssh_key
stageSshKey = path.join(os.path.expanduser("~"), ".ssh", stageSshKey)
createIndexFiles = releaseConfig.get('makeIndexFiles', False) \
and productName != 'xulrunner'
syncPartnerBundles = releaseConfig.get('syncPartnerBundles', False) \
and productName != 'xulrunner'
ftpSymlinkName = releaseConfig.get('ftpSymlinkName')
bouncer_aliases = releaseConfig.get('bouncer_aliases')
productDetailsRepo = releaseConfig.get('productDetailsRepo')
开发者ID:lundjordan,项目名称:build-tools,代码行数:32,代码来源:stage-tasks.py
示例19: list
parser.error("Need to provide a list of products, e.g. -p firefox,fennec")
if not options.dryrun and not args:
parser.error("Need to provide a master to sendchange to, or -d for a dryrun")
elif not options.branch:
parser.error("Need to provide a branch to release")
elif not options.releaseConfigFiles:
parser.error("Need to provide a release config file")
logging.basicConfig(level=options.loglevel,
format="%(asctime)s : %(levelname)s : %(message)s")
releaseConfig = None
test_success = True
buildNumber = options.buildNumber
for releaseConfigFile in list(reversed(options.releaseConfigFiles)):
releaseConfig = readReleaseConfig(releaseConfigFile)
if not options.buildNumber:
log.warn("No buildNumber specified, using buildNumber in release_config, which may be out of date!")
options.buildNumber = releaseConfig['buildNumber']
if options.check:
from config import BRANCHES
branchConfig = BRANCHES[options.branch]
#Match command line options to defaults in release_configs
if not verify_options(options, releaseConfig):
test_success = False
log.error("Error verifying command-line options, attempting checking repo")
# verify that mozconfigs for this release pass diff with nightly, compared to a whitelist
try:
开发者ID:mjessome,项目名称:tools,代码行数:31,代码来源:release_sanity.py
示例20: mkdtemp
else:
cleanup_configs = True
configs_dir = mkdtemp()
remote = make_hg_url(HG, options.configs_repo_url)
retry(mercurial, args=(remote, configs_dir),
kwargs={'branch': options.configs_branch})
update(configs_dir, options.configs_branch)
# https://bugzilla.mozilla.org/show_bug.cgi?id=678103#c5
# This goes through the list of config files in reverse order, which is a
# hacky way of making sure that the config file that's listed first is the
# one that's loaded in releaseConfig for the sendchange.
for releaseConfigFile in list(reversed(options.releaseConfigFiles)):
abs_release_config_file = path.join(configs_dir, 'mozilla',
releaseConfigFile)
releaseConfig = readReleaseConfig(abs_release_config_file)
products.append(releaseConfig['productName'])
if not options.buildNumber:
log.warn("No buildNumber specified, using buildNumber in"
" release_config, which may be out of date!")
options.buildNumber = releaseConfig['buildNumber']
if options.check:
site.addsitedir(path.join(configs_dir, 'mozilla'))
from config import BRANCHES
source_repo = 'mozilla'
try:
branchConfig = BRANCHES[options.branch]
except KeyError:
from thunderbird_config import BRANCHES
开发者ID:magnyld,项目名称:build-tools,代码行数:31,代码来源:release_sanity.py
注:本文中的release.info.readReleaseConfig函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论