f = open(l10nRevisionFile) if 'multilocale' not in f.read(): test_success = False log.error("MultiLocale enabled but not present in l10n changesets") f.close() # verify that l10n changesets match the shipped locales if releaseConfig.get('shippedLocalesPath'): sr = releaseConfig['sourceRepositories'][source_repo] sourceRepoPath = sr.get('clonePath', sr['path']) shippedLocales = getLocaleListFromShippedLocales( getShippedLocales( releaseConfig['productName'], releaseConfig['appName'], releaseConfig['version'], releaseConfig['buildNumber'], sourceRepoPath, 'http://hg.mozilla.org', sr['revision'], )) # l10n_changesets do not have an entry for en-US if 'en-US' in shippedLocales: shippedLocales.remove('en-US') if not verify_l10n_shipped_locales(l10nRevisionFile, shippedLocales): test_success = False log.error("Error verifying l10n_changesets matches" " shipped_locales") # verify that the relBranch + revision in the release_configs # exists in hg
#verify that l10n changesets match the dashboard if not verify_l10n_dashboard(releaseConfig['l10nRevisionFile']): test_success = False log.error("Error verifying l10n dashboard changesets") #verify that l10n changesets match the shipped locales in firefox product if releaseConfig.get('shippedLocalesPath'): for sr in releaseConfig['sourceRepositories'].values(): sourceRepoPath = sr.get('clonePath', sr['path']) shippedLocales = getLocaleListFromShippedLocales( getShippedLocales( releaseConfig['productName'], releaseConfig['appName'], releaseConfig['version'], releaseConfig['buildNumber'], sourceRepoPath, 'http://hg.mozilla.org', sr['revision'], )) # l10n_changesets do not have an entry for en-US if 'en-US' in shippedLocales: shippedLocales.remove('en-US') if not verify_l10n_shipped_locales( releaseConfig['l10nRevisionFile'], shippedLocales): test_success = False log.error( "Error verifying l10n_changesets matches shipped_locales" ) #verify that the relBranch + revision in the release_configs exists in hg
def createSnippets(brandName, product, appName, version, appVersion, oldVersion, oldAppVersion, buildNumber, oldBuildNumber, platforms, channels, oldBaseSnippetDir, stageServer, hg, sourceRepo, generatePartials): errs = [] snippets = ['complete.txt'] if generatePartials: snippets.append('partial.txt') previousCandidateIDs = findOldBuildIDs(product, version, buildNumber, platforms, server=stageServer) oldShippedLocales = getShippedLocales(product, appName, oldVersion, oldBuildNumber, sourceRepo, hg) shippedLocales = getShippedLocales(product, appName, version, buildNumber, sourceRepo, hg) for platform in previousCandidateIDs.keys(): update_platforms = buildbot2updatePlatforms(platform) oldVersionBuildID = getBuildID(platform, product, oldVersion, oldBuildNumber, server=stageServer) oldPlatformLocales = getPlatformLocales(oldShippedLocales, (platform, ))[platform] platformLocales = getPlatformLocales(shippedLocales, (platform, ))[platform] commonLocales = getCommonLocales(platformLocales, oldPlatformLocales) for chan in channels: baseSnippetDir = getSnippetDirname(oldBaseSnippetDir, chan) if not os.path.exists(baseSnippetDir): errs.append( "Can't generate snippets for %s because %s doesn't exist" % (chan, baseSnippetDir)) continue for buildID in previousCandidateIDs[platform]: for locale in commonLocales: for update_platform in update_platforms: try: oldFile = os.path.join(baseSnippetDir, brandName, oldAppVersion, update_platform, oldVersionBuildID, locale, chan, 'complete.txt') oldCompleteSnippet = open(oldFile).read() except Exception, e: errs.append("Error reading from %s\n%s" % \ (oldFile, e)) continue newDir = os.path.join(baseSnippetDir, brandName, appVersion, update_platform, buildID, locale, chan) try: os.makedirs(newDir) log.info("Creating snippets for %s" % newDir) for f in snippets: newFile = os.path.join(newDir, f) log.info(" %s" % f) writeSnippet(newFile, oldCompleteSnippet) except OSError, e: errs.append("Error creating %s\n%s" % (newDir, e)) except Exception, e: errs.append("Hit error creating %s\n%s" % \ (newFile, e)) for l in [ l for l in platformLocales if l not in commonLocales ]: log.debug( "WARNING: %s not in oldVersion for %s, did not generate snippets for it" % (l, platform))
def createSnippets( brandName, product, appName, version, appVersion, oldVersion, oldAppVersion, buildNumber, oldBuildNumber, platforms, channels, oldBaseSnippetDir, stageServer, hg, sourceRepo, generatePartials): errs = [] snippets = ['complete.txt'] if generatePartials: snippets.append('partial.txt') previousCandidateIDs = findOldBuildIDs(product, version, buildNumber, platforms, server=stageServer) oldShippedLocales = getShippedLocales(product, appName, oldVersion, oldBuildNumber, sourceRepo, hg) shippedLocales = getShippedLocales(product, appName, version, buildNumber, sourceRepo, hg) for platform in previousCandidateIDs.keys(): update_platforms = buildbot2updatePlatforms(platform) oldVersionBuildID = getBuildID(platform, product, oldVersion, oldBuildNumber, server=stageServer) oldPlatformLocales = getPlatformLocales(oldShippedLocales, (platform,))[platform] platformLocales = getPlatformLocales(shippedLocales, (platform,))[platform] commonLocales = getCommonLocales(platformLocales, oldPlatformLocales) for chan in channels: baseSnippetDir = getSnippetDirname(oldBaseSnippetDir, chan) if not os.path.exists(baseSnippetDir): errs.append("Can't generate snippets for %s because %s doesn't exist" % (chan, baseSnippetDir)) continue for buildID in previousCandidateIDs[platform]: for locale in commonLocales: for update_platform in update_platforms: try: oldFile = os.path.join(baseSnippetDir, brandName, oldAppVersion, update_platform, oldVersionBuildID, locale, chan, 'complete.txt') oldCompleteSnippet = open(oldFile).read() except Exception, e: errs.append("Error reading from %s\n%s" % (oldFile, e)) continue newDir = os.path.join(baseSnippetDir, brandName, appVersion, update_platform, buildID, locale, chan) try: os.makedirs(newDir) log.info("Creating snippets for %s" % newDir) for f in snippets: newFile = os.path.join(newDir, f) log.info(" %s" % f) writeSnippet(newFile, oldCompleteSnippet) except OSError, e: errs.append("Error creating %s\n%s" % (newDir, e)) except Exception, e: errs.append("Hit error creating %s\n%s" % (newFile, e)) for l in [l for l in platformLocales if l not in commonLocales]: log.debug("WARNING: %s not in oldVersion for %s, did not generate snippets for it" % (l, platform))
def main(): """ Parse options and run download loop """ parser = OptionParser(__doc__) parser.set_defaults( product="firefox", hgurl="http://hg.mozilla.org", repo_path="build/buildbot-configs", source_repo_key="mozilla" ) parser.add_option("-p", "--product", dest="product", help="product name") parser.add_option("-r", "--repo-path", dest="repo_path", help="configs repo path") parser.add_option("-l", "--hgurl", dest="hgurl", help="hg URL prefix") parser.add_option("-P", "--platform", dest="platform", help="platform being signed on") parser.add_option("--source-repo-key", dest="source_repo_key", help="Which sourceRepository entry to pull sourceRepoPath from") parser.add_option("-V", "--verify", dest="verify", action="store_true", help="Just verify that the deliverables are present") options, args = parser.parse_args() if len(args) < 6: parser.error("") version = args[0] unsigned_dir = args[1] ssh_key = args[2] stage_username = args[3] stage_host = args[4] release_config_file = args[5] prefix = "%s/%s/raw-file/%s_%s_RELEASE/%s" release_config_url = prefix % ( options.hgurl, options.repo_path, options.product.upper(), version.replace(".", "_"), release_config_file, ) release_config = extract_config_info(release_config_url) allplatforms = release_config['enUSPlatforms'] # If we explicitly specify the platform we're signing on, use the # download_platform_map to count the other platform deliverables that # will be downloaded and signed on this signing platform if options.platform: # only look at platforms that are also in the release configs allplatforms = [p for p in download_platform_map[options.platform] if p in release_config['enUSPlatforms']] log.info("Looking for builds on : %s" % allplatforms) platform_locales = getPlatformLocales(getShippedLocales( release_config['productName'], release_config['appName'], release_config['version'], release_config['buildNumber'], release_config['sourceRepositories'][options.source_repo_key]['path'], options.hgurl), allplatforms) if options.verify: if not check_unsigned_dir( unsigned_dir, platform_locales, allplatforms, release_config.get('signedPlatforms', ('win32',)), release_config['doPartnerRepacks']): log.fatal("Error, missing signing deliverables") exit(1) else: log.info("All Deliverables Present") exit() while not check_unsigned_dir( unsigned_dir, platform_locales, allplatforms, release_config.get('signedPlatforms', ('win32',)), release_config['doPartnerRepacks']): download_builds(ssh_key, stage_username, stage_host, release_config) time.sleep(10)
def main(): """ Parse options and run download loop """ parser = OptionParser(__doc__) parser.set_defaults(product="firefox", hgurl="http://hg.mozilla.org", repo_path="build/buildbot-configs", source_repo_key="mozilla") parser.add_option("-p", "--product", dest="product", help="product name") parser.add_option("-r", "--repo-path", dest="repo_path", help="configs repo path") parser.add_option("-l", "--hgurl", dest="hgurl", help="hg URL prefix") parser.add_option("-P", "--platform", dest="platform", help="platform being signed on") parser.add_option( "--source-repo-key", dest="source_repo_key", help="Which sourceRepository entry to pull sourceRepoPath from") parser.add_option("-V", "--verify", dest="verify", action="store_true", help="Just verify that the deliverables are present") options, args = parser.parse_args() if len(args) < 6: parser.error("") version = args[0] unsigned_dir = args[1] ssh_key = args[2] stage_username = args[3] stage_host = args[4] release_config_file = args[5] prefix = "%s/%s/raw-file/%s_%s_RELEASE/%s" release_config_url = prefix % ( options.hgurl, options.repo_path, options.product.upper(), version.replace(".", "_"), release_config_file, ) release_config = extract_config_info(release_config_url) allplatforms = release_config['enUSPlatforms'] # If we explicitly specify the platform we're signing on, use the # download_platform_map to count the other platform deliverables that # will be downloaded and signed on this signing platform if options.platform: # only look at platforms that are also in the release configs allplatforms = [ p for p in download_platform_map[options.platform] if p in release_config['enUSPlatforms'] ] log.info("Looking for builds on : %s" % allplatforms) platform_locales = getPlatformLocales( getShippedLocales( release_config['productName'], release_config['appName'], release_config['version'], release_config['buildNumber'], release_config['sourceRepositories'][ options.source_repo_key]['path'], options.hgurl), allplatforms) if options.verify: if not check_unsigned_dir( unsigned_dir, platform_locales, allplatforms, release_config.get('signedPlatforms', ('win32', )), release_config['doPartnerRepacks']): log.fatal("Error, missing signing deliverables") exit(1) else: log.info("All Deliverables Present") exit() while not check_unsigned_dir( unsigned_dir, platform_locales, allplatforms, release_config.get('signedPlatforms', ('win32', )), release_config['doPartnerRepacks']): download_builds(ssh_key, stage_username, stage_host, release_config) time.sleep(10)