本文整理汇总了Python中release.paths.makeCandidatesDir函数的典型用法代码示例。如果您正苦于以下问题:Python makeCandidatesDir函数的具体用法?Python makeCandidatesDir怎么用?Python makeCandidatesDir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了makeCandidatesDir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_data
def generate_data(self, appVersion, productName, version, buildNumber,
updateChannels, stagingServer, bouncerServer,
enUSPlatforms, schemaVersion, **updateKwargs):
assert schemaVersion in (2, 3), 'Unhandled schema version %s' % schemaVersion
self.name = get_release_blob_name(productName, version, buildNumber)
data = {
'name': self.name,
'detailsUrl': getProductDetails(productName.lower(), appVersion),
'platforms': {},
'fileUrls': {},
'ftpFilenames': {},
'bouncerProducts': {},
}
data['appVersion'] = appVersion
data['platformVersion'] = appVersion
data['displayVersion'] = getPrettyVersion(version)
# XXX: This is a hack for bug 1045583. We should remove it, and always
# use "candidates" for nightlyDir after the switch to Balrog is complete.
if productName.lower() == "mobile":
nightlyDir = "candidates"
else:
nightlyDir = "nightly"
for channel in updateChannels:
if channel in ('betatest', 'esrtest') or "localtest" in channel:
dir_ = makeCandidatesDir(productName.lower(), version,
buildNumber, server=stagingServer, protocol='http',
nightlyDir=nightlyDir)
data['fileUrls'][channel] = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_
else:
url = 'http://%s/?product=%%PRODUCT%%&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % bouncerServer
data['fileUrls'][channel] = url
# XXX: quick hack for bug 1021026. We should be using Bouncer for this
# after we implement better solution talked about in comments 2 through 4
if channel == 'release':
dir_ = makeCandidatesDir(productName.lower(), version,
buildNumber, server='download.cdn.mozilla.net', protocol='http',
nightlyDir=nightlyDir)
url = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_
data['fileUrls']['beta'] = url
data['fileUrls']['beta-cdntest'] = url
data.update(self._get_update_data(productName, version, **updateKwargs))
for platform in enUSPlatforms:
updatePlatforms = buildbot2updatePlatforms(platform)
bouncerPlatform = buildbot2bouncer(platform)
ftpPlatform = buildbot2ftp(platform)
data['platforms'][updatePlatforms[0]] = {
'OS_BOUNCER': bouncerPlatform,
'OS_FTP': ftpPlatform
}
for aliasedPlatform in updatePlatforms[1:]:
data['platforms'][aliasedPlatform] = {
'alias': updatePlatforms[0]
}
return data
示例2: _getFileUrls
def _getFileUrls(self, productName, version, buildNumber, updateChannels,
stagingServer, bouncerServer, partialUpdates):
data = {"fileUrls": {}}
# TODO: comment about *
uniqueChannels = ["*"]
for c in updateChannels:
# Channels that aren't localtest all use the same URLs, which are
# added in the catch all. To avoid duplication, we simply don't
# add them explicitly.
if c in ("betatest", "esrtest") or "localtest" in c:
uniqueChannels.append(c)
for channel in uniqueChannels:
data["fileUrls"][channel] = {
"completes": {}
}
if channel in ('betatest', 'esrtest') or "localtest" in channel:
dir_ = makeCandidatesDir(productName.lower(), version,
buildNumber, server=stagingServer,
protocol='http')
filename = "%s-%s.complete.mar" % (productName.lower(), version)
data["fileUrls"][channel]["completes"]["*"] = "%supdate/%%OS_FTP%%/%%LOCALE%%/%s" % (dir_, filename)
else:
if productName.lower() == "fennec":
bouncerProduct = "%s-%s" % (productName.lower(), version)
else:
bouncerProduct = "%s-%s-complete" % (productName.lower(), version)
url = 'http://%s/?product=%s&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % (bouncerServer, bouncerProduct)
data["fileUrls"][channel]["completes"]["*"] = url
if not partialUpdates:
return data
for channel in uniqueChannels:
data["fileUrls"][channel]["partials"] = {}
for previousVersion, previousInfo in partialUpdates.iteritems():
from_ = get_release_blob_name(productName, previousVersion,
previousInfo["buildNumber"],
self.dummy)
if channel in ('betatest', 'esrtest') or "localtest" in channel:
dir_ = makeCandidatesDir(productName.lower(), version,
buildNumber, server=stagingServer,
protocol='http')
filename = "%s-%s-%s.partial.mar" % (productName.lower(), previousVersion, version)
data["fileUrls"][channel]["partials"][from_] = "%supdate/%%OS_FTP%%/%%LOCALE%%/%s" % (dir_, filename)
else:
bouncerProduct = "%s-%s-partial-%s" % (productName.lower(), version, previousVersion)
url = 'http://%s/?product=%s&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % (bouncerServer, bouncerProduct)
data["fileUrls"][channel]["partials"][from_] = url
return data
示例3: doSyncPartnerBundles
def doSyncPartnerBundles(productName, version, buildNumber, stageServer,
stageUsername, stageSshKey):
candidates_dir = makeCandidatesDir(productName, version, buildNumber)
for dest, src in PARTNER_BUNDLE_MAPPINGS.iteritems():
full_dest = path.join(PARTNER_BUNDLE_DIR, dest)
full_src = path.join(candidates_dir, 'partner-repacks', src)
full_src = full_src % {'version': version}
run_remote_cmd(
['cp', '-f', full_src, full_dest],
server=stageServer, username=stageUsername, sshKey=stageSshKey
)
# And fix the permissions...
run_remote_cmd(
['find', PARTNER_BUNDLE_DIR, '-type', 'd',
'-exec', 'chmod', '775', '{}', '\\;'],
server=stageServer, username=stageUsername, sshKey=stageSshKey
)
run_remote_cmd(
['find', PARTNER_BUNDLE_DIR, '-name', '"*.exe"',
'-exec', 'chmod', '775', '{}', '\\;'],
server=stageServer, username=stageUsername, sshKey=stageSshKey
)
run_remote_cmd(
['find', PARTNER_BUNDLE_DIR, '-name', '"*.dmg"',
'-exec', 'chmod', '775', '{}', '\\;'],
server=stageServer, username=stageUsername, sshKey=stageSshKey
)
示例4: downloadRelease
def downloadRelease(productName, version, buildNumber, stageServer,
stageUsername=None, stageSshKey=None,
stageUrlPrefix='http://stage.mozilla.org'):
candidatesDir = makeCandidatesDir(productName, version,
buildNumber).rstrip('/')
releasesDir = makeReleasesDir(productName, version).rstrip('/')
commands = [
'rm -rf %s' % candidatesDir,
'rm -rf %s' % releasesDir,
'mkdir -p %s' % candidatesDir,
'cd %(candidatesDir)s && \
wget -nv -r -np -nH --cut-dirs=6 -R index.html* \
-X %(candidatesDir)s/unsigned \
-X %(candidatesDir)s/contrib* \
-X %(candidatesDir)s/partner-repacks \
-X %(candidatesDir)s/win32-EUballot \
%(stageUrlPrefix)s%(candidatesDir)s/' % \
(dict(candidatesDir=candidatesDir, stageUrlPrefix=stageUrlPrefix)),
'ln -s %s %s' % (candidatesDir, releasesDir),
]
for command in commands:
run_remote_cmd(command, server=stageServer, username=stageUsername,
sshKey=stageSshKey)
示例5: downloadReleaseBuilds
def downloadReleaseBuilds(stageServer, productName, brandName, version,
buildNumber, platform, candidatesDir=None,
signed=False, usePymake=False):
if candidatesDir is None:
candidatesDir = makeCandidatesDir(productName, version, buildNumber,
protocol='http', server=stageServer)
files = makeReleaseRepackUrls(productName, brandName, version, platform,
signed=signed)
env = {}
for fileName, remoteFile in files.iteritems():
url = '/'.join([p.strip('/') for p in [candidatesDir,
urllib.quote(remoteFile)]])
log.info("Downloading %s to %s", url, fileName)
urlretrieve(url, fileName)
if fileName.endswith('exe'):
if usePymake:
env['WIN32_INSTALLER_IN'] = msys2windows(path.join(os.getcwd(),
fileName))
else:
env['WIN32_INSTALLER_IN'] = windows2msys(path.join(os.getcwd(),
fileName))
else:
if platform.startswith('win') and not usePymake:
env['ZIP_IN'] = windows2msys(path.join(os.getcwd(), fileName))
else:
env['ZIP_IN'] = msys2windows(path.join(os.getcwd(), fileName))
return env
示例6: pushToMirrors
def pushToMirrors(productName, version, buildNumber, stageServer,
stageUsername=None, stageSshKey=None, excludes=None,
extra_excludes=None, dryRun=False):
""" excludes overrides DEFAULT_RSYNC_EXCLUDES, extra_exludes will be
appended to DEFAULT_RSYNC_EXCLUDES. """
source_dir = makeCandidatesDir(productName, version, buildNumber)
target_dir = makeReleasesDir(productName, version)
if not excludes:
excludes = DEFAULT_RSYNC_EXCLUDES
if extra_excludes:
excludes += extra_excludes
# fail/warn if target directory exists depending on dry run mode
try:
run_remote_cmd(['test', '!', '-d', target_dir], server=stageServer,
username=stageUsername, sshKey=stageSshKey)
except CalledProcessError:
if not dryRun:
raise
else:
log.warning('WARN: target directory %s exists', target_dir)
if not dryRun:
run_remote_cmd(['mkdir', '-p', target_dir], server=stageServer,
username=stageUsername, sshKey=stageSshKey)
run_remote_cmd(['chmod', 'u=rwx,g=rxs,o=rx', target_dir], server=stageServer,
username=stageUsername, sshKey=stageSshKey)
rsync_cmd = ['rsync', '-av' ]
if dryRun:
rsync_cmd.append('-n')
run_remote_cmd(rsync_cmd + excludes + [source_dir, target_dir],
server=stageServer, username=stageUsername,
sshKey=stageSshKey)
示例7: createRepacks
def createRepacks(sourceRepo, revision, l10nRepoDir, l10nBaseRepo,
mozconfigPath, objdir, makeDirs, locales, ftpProduct,
appName, version, appVersion, buildNumber, stageServer,
stageUsername, stageSshKey, compareLocalesRepo, merge,
platform, stage_platform, brand, mobileDirName):
sourceRepoName = path.split(sourceRepo)[-1]
nightlyDir = "candidates"
localeSrcDir = path.join(sourceRepoName, objdir, mobileDirName, "locales")
# Even on Windows we need to use "/" as a separator for this because
# compare-locales doesn"t work any other way
l10nIni = "/".join([sourceRepoName, mobileDirName, "locales", "l10n.ini"])
env = {
"MOZ_OBJDIR": objdir,
"MOZ_PKG_VERSION": version,
"UPLOAD_HOST": stageServer,
"UPLOAD_USER": stageUsername,
"UPLOAD_SSH_KEY": stageSshKey,
"UPLOAD_TO_TEMP": "1",
# Android signing
"JARSIGNER": os.path.join(os.getcwd(), "scripts", "release",
"signing", "mozpass.py")
}
build.misc.cleanupObjdir(sourceRepoName, objdir, mobileDirName)
retry(mercurial, args=(sourceRepo, sourceRepoName))
update(sourceRepoName, revision=revision)
l10nRepackPrep(sourceRepoName, objdir, mozconfigPath,
l10nRepoDir, makeDirs, localeSrcDir, env)
fullCandidatesDir = makeCandidatesDir(appName, version, buildNumber,
protocol='http', server=stageServer,
nightlyDir=nightlyDir)
input_env = retry(downloadReleaseBuilds,
args=(stageServer, ftpProduct, brand, version,
buildNumber, stage_platform, fullCandidatesDir))
env.update(input_env)
print "env pre-locale: %s" % str(env)
failed = []
for l in locales:
try:
# adding locale into builddir
env["POST_UPLOAD_CMD"] = postUploadCmdPrefix(
to_mobile_candidates=True,
product=appName,
version=version,
builddir='%s/%s' % (stage_platform, l),
buildNumber=buildNumber,
nightly_dir=nightlyDir,)
print "env post-locale: %s" % str(env)
repackLocale(str(l), l10nRepoDir, l10nBaseRepo, revision,
localeSrcDir, l10nIni, compareLocalesRepo, env, merge)
except Exception, e:
failed.append((l, format_exc()))
示例8: generate_data
def generate_data(self, appVersion, productName, version, buildNumber,
partialUpdates, updateChannels, stagingServer,
bouncerServer, enUSPlatforms, schemaVersion):
# TODO: Multiple partial support. Probably as a part of bug 797033.
previousVersion = str(max(StrictVersion(v) for v in partialUpdates))
self.name = get_release_blob_name(productName, version, buildNumber)
data = {
'name': self.name,
'detailsUrl': getProductDetails(productName.lower(), appVersion),
'platforms': {},
'fileUrls': {},
'ftpFilenames': {},
'bouncerProducts': {},
}
assert schemaVersion in (1, 2), 'Unhandled schema version %s' % schemaVersion
if schemaVersion == 1:
data['appv'] = appVersion
data['extv'] = appVersion
elif schemaVersion == 2:
data['appVersion'] = appVersion
data['platformVersion'] = appVersion
data['displayVersion'] = getPrettyVersion(version)
for channel in updateChannels:
if channel in ('betatest', 'esrtest'):
dir_ = makeCandidatesDir(productName.lower(), version,
buildNumber, server=stagingServer, protocol='http')
data['fileUrls'][channel] = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_
else:
url = 'http://%s/?product=%%PRODUCT%%&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % bouncerServer
data['fileUrls'][channel] = url
data['ftpFilenames']['complete'] = '%s-%s.complete.mar' % (productName.lower(), version)
data['ftpFilenames']['partial'] = '%s-%s-%s.partial.mar' % (productName.lower(), previousVersion, version)
data['bouncerProducts']['complete'] = '%s-%s-Complete' % (productName.capitalize(), version)
data['bouncerProducts']['partial'] = '%s-%s-Partial-%s' % (productName.capitalize(), version, previousVersion)
for platform in enUSPlatforms:
updatePlatforms = buildbot2updatePlatforms(platform)
bouncerPlatform = buildbot2bouncer(platform)
ftpPlatform = buildbot2ftp(platform)
data['platforms'][updatePlatforms[0]] = {
'OS_BOUNCER': bouncerPlatform,
'OS_FTP': ftpPlatform
}
for aliasedPlatform in updatePlatforms[1:]:
data['platforms'][aliasedPlatform] = {
'alias': updatePlatforms[0]
}
return data
示例9: _getFileUrls
def _getFileUrls(self, productName, version, buildNumber, updateChannels,
ftpServer, bouncerServer, partialUpdates):
data = {}
for channel in updateChannels:
if channel in ('betatest', 'esrtest') or "localtest" in channel:
dir_ = makeCandidatesDir(productName.lower(), version,
buildNumber, server=ftpServer, protocol='http')
data["fileUrls"][channel] = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_
else:
url = 'http://%s/?product=%%PRODUCT%%&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % bouncerServer
data["fileUrls"][channel] = url
return data
示例10: _getFileUrls
def _getFileUrls(self, productName, version, buildNumber, updateChannels,
ftpServer, bouncerServer, partialUpdates):
data = {}
for channel in updateChannels:
if channel in ('betatest', 'esrtest') or "localtest" in channel:
dir_ = makeCandidatesDir(productName.lower(), version,
buildNumber, server=ftpServer,
protocol='http')
data["fileUrls"][channel] = _FTP % dir_
else:
url = _URL % bouncerServer
data["fileUrls"][channel] = url
return data
示例11: getBuildID
def getBuildID(platform, product, version, buildNumber, nightlyDir='nightly',
server='stage.mozilla.org'):
infoTxt = makeCandidatesDir(product, version, buildNumber, nightlyDir,
protocol='http', server=server) + \
'%s_info.txt' % platform
try:
buildInfo = urlopen(infoTxt).read()
except:
log.error("Failed to retrieve %s" % infoTxt)
raise
for line in buildInfo.splitlines():
key, value = line.rstrip().split('=', 1)
if key == 'buildID':
return value
示例12: getBuildID
def getBuildID(platform, product, version, buildNumber, nightlyDir="nightly", server="stage.mozilla.org"):
infoTxt = (
makeCandidatesDir(product, version, buildNumber, nightlyDir, protocol="http", server=server)
+ "%s_info.txt" % platform
)
try:
buildInfo = urlopen(infoTxt).read()
except:
log.error("Failed to retrieve %s" % infoTxt)
raise
for line in buildInfo.splitlines():
key, value = line.rstrip().split("=", 1)
if key == "buildID":
return value
示例13: makeIndexFiles
def makeIndexFiles(productName, version, buildNumber, stageServer,
stageUsername, stageSshKey):
candidates_dir = makeCandidatesDir(productName, version, buildNumber)
indexFile = NamedTemporaryFile()
indexFile.write(indexFileTemplate % {'version': version})
indexFile.flush()
scp(
indexFile.name, '%[email protected]%s:%s/index.html' % (
stageUsername, stageServer, candidates_dir),
sshKey=stageSshKey)
run_remote_cmd(['chmod', '644', '%s/index.html' % candidates_dir],
server=stageServer, username=stageUsername, sshKey=stageSshKey)
run_remote_cmd(
['find', candidates_dir, '-mindepth', '1', '-type', 'd', '-not', '-regex', '.*contrib.*', '-exec', 'cp', '-pv', '%s/index.html' % candidates_dir, '{}', '\\;'],
server=stageServer, username=stageUsername, sshKey=stageSshKey)
示例14: downloadUpdate
def downloadUpdate(stageServer, productName, version, buildNumber,
platform, locale, candidatesDir=None):
if candidatesDir is None:
candidatesDir = makeCandidatesDir(productName, version, buildNumber,
protocol='http', server=stageServer)
fileName = '%s-%s.complete.mar' % (productName, version)
destFileName = '%s-%s.%s.complete.mar' % (productName, version, locale)
platformDir = buildbot2ftp(platform)
url = '/'.join([p.strip('/') for p in [
candidatesDir, 'update', platformDir, locale, fileName]])
log.info("Downloading %s to %s", url, destFileName)
remote_f = urlopen(url)
local_f = open(destFileName, "wb")
local_f.write(remote_f.read())
local_f.close()
return destFileName
示例15: generate_data
def generate_data(self, appVersion, productName, version, buildNumber,
updateChannels, stagingServer, bouncerServer,
enUSPlatforms, schemaVersion, **updateKwargs):
assert schemaVersion in (2, 3), 'Unhandled schema version %s' % schemaVersion
self.name = get_release_blob_name(productName, version, buildNumber)
data = {
'name': self.name,
'detailsUrl': getProductDetails(productName.lower(), appVersion),
'platforms': {},
'fileUrls': {},
'ftpFilenames': {},
'bouncerProducts': {},
}
data['appVersion'] = appVersion
data['platformVersion'] = appVersion
data['displayVersion'] = getPrettyVersion(version)
for channel in updateChannels:
if channel in ('betatest', 'esrtest'):
dir_ = makeCandidatesDir(productName.lower(), version,
buildNumber, server=stagingServer, protocol='http')
data['fileUrls'][channel] = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_
else:
url = 'http://%s/?product=%%PRODUCT%%&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % bouncerServer
data['fileUrls'][channel] = url
data.update(self._get_update_data(productName, version, **updateKwargs))
for platform in enUSPlatforms:
updatePlatforms = buildbot2updatePlatforms(platform)
bouncerPlatform = buildbot2bouncer(platform)
ftpPlatform = buildbot2ftp(platform)
data['platforms'][updatePlatforms[0]] = {
'OS_BOUNCER': bouncerPlatform,
'OS_FTP': ftpPlatform
}
for aliasedPlatform in updatePlatforms[1:]:
data['platforms'][aliasedPlatform] = {
'alias': updatePlatforms[0]
}
return data