def buildbot_loop(): while True: # util.get_svn_versions() might throw an exception due to # temporary network problems, so retry try: (local_ver, latest_ver) = util.get_svn_versions() except: print("get_svn_versions() threw an exception") time.sleep(120) continue print("local ver: %s, latest ver: %s" % (local_ver, latest_ver)) revs_built = 0 while int(local_ver) <= int(latest_ver): if not has_already_been_built(local_ver): build_version_try(local_ver) revs_built += 1 else: print("We have already built revision %s" % local_ver) local_ver = str(int(local_ver)+1) delete_old_logs() # don't sleep if we built something in this cycle. a new checkin might # have happened while we were working if revs_built > 0: continue print("Sleeping for 15 minutes") time.sleep(60*15) # 15 mins
def build_curr(force=False): (local_ver, latest_ver) = util.get_svn_versions() print("local ver: %s, latest ver: %s" % (local_ver, latest_ver)) if not has_already_been_built(local_ver) or force: build_version(local_ver) else: print("We have already built revision %s" % local_ver)
def cmp_with_last(): os.chdir(sum_efi_dir()) (local_ver, latest_ver) = util.get_svn_versions() latest_ver = int(latest_ver) build_ver(latest_ver) build_efi_result(latest_ver) os.chdir(g_src_dir) build_clean(latest_ver + 1) build_efi_result_current() diff_efi(efi_result_bz2_file(latest_ver), "efi.txt.bz2")
def cmp_with_last(): os.chdir(sum_efi_dir()) (local_ver, latest_ver) = util.get_svn_versions() latest_ver = int(latest_ver) build_ver(latest_ver) build_efi_result(latest_ver) os.chdir(g_src_dir) build_clean(latest_ver + 1) build_efi_result_current() s = diff_efi(efi_result_bz2_file(latest_ver), "efi.txt.bz2") print(s) with open("last_efi_cmp.txt", "w") as fo: fo.write(s)
def uploadStringsIfChanged(skip_svn_check=False): # needs to have upload secret to protect apptranslator.org server from # abuse config = util.load_config() uploadsecret = config.trans_ul_secret if None is uploadsecret: print("Skipping string upload because don't have upload secret") return if not skip_svn_check: # Note: this check might be confusing due to how svn work # Unforunately, if you have local latest revision 5 and do a checkin to create # revision 6, svn info says that locally you're still on revision 5, even though # the code is actually as revision 6. # You need to do "svn update" to update local version number # Unfortunately I can't do it automatically here since it would be dangerous # (i.e. it would update code locally). # svn update is called in build.py, so it's not a problem if it's run # from ./scripts/build-release.bat or ./scripts/build-pre-release.bat try: (local_ver, latest_ver) = util.get_svn_versions() except: print( "Skipping string upload because SVN isn't available to check for up-to-date-ness" ) return if int(latest_ver) > int(local_ver): print( "Skipping string upload because your local version (%s) is older than latest in svn (%s)" % (local_ver, latest_ver)) return strings = extract_strings_from_c_files() strings.sort() s = "AppTranslator strings\n" + string.join(strings, "\n") s = s.encode("utf8") if lastUploaded() == s: print( "Skipping upload because strings haven't changed since last upload" ) else: uploadStringsToServer(s, uploadsecret) saveLastUploaded(s) print("Don't forget to checkin strings/last_uploaded.txt")
def buildbot_loop(): global g_time_of_last_build while True: # util.get_svn_versions() might throw an exception due to # temporary network problems, so retry try: (local_ver, latest_ver) = util.get_svn_versions() except: print("get_svn_versions() threw an exception") time.sleep(120) continue print("local ver: %s, latest ver: %s" % (local_ver, latest_ver)) revs_built = 0 while int(local_ver) <= int(latest_ver): if not has_already_been_built(local_ver): build_version_retry(local_ver) revs_built += 1 else: print("We have already built revision %s" % local_ver) local_ver = str(int(local_ver) + 1) delete_old_logs() # don't sleep if we built something in this cycle. a new checkin might # have happened while we were working if revs_built > 0: g_time_of_last_build = datetime.datetime.now() continue secs_until_prerelease = None if g_time_of_last_build is not None: td = datetime.datetime.now() - g_time_of_last_build secs_until_prerelease = TIME_BETWEEN_PRE_RELEASE_BUILDS_IN_SECS - \ int(td.total_seconds()) if secs_until_prerelease < 0: build_pre_release() g_time_of_last_build = None if secs_until_prerelease is None: print("Sleeping for 15 minutes to wait for new checkin") else: print("Sleeping for 15 minutes, %s until pre-release" % pretty_print_secs(secs_until_prerelease)) time.sleep(60 * 15) # 15 mins
def uploadStringsIfChanged(skip_svn_check=False): # needs to have upload secret to protect apptranslator.org server from # abuse config = util.load_config() uploadsecret = config.trans_ul_secret if None is uploadsecret: print("Skipping string upload because don't have upload secret") return if not skip_svn_check: # Note: this check might be confusing due to how svn work # Unforunately, if you have local latest revision 5 and do a checkin to create # revision 6, svn info says that locally you're still on revision 5, even though # the code is actually as revision 6. # You need to do "svn update" to update local version number # Unfortunately I can't do it automatically here since it would be dangerous # (i.e. it would update code locally). # svn update is called in build.py, so it's not a problem if it's run # from ./scripts/build-release.bat or ./scripts/build-pre-release.bat try: (local_ver, latest_ver) = util.get_svn_versions() except: print( "Skipping string upload because SVN isn't available to check for up-to-date-ness") return if int(latest_ver) > int(local_ver): print( "Skipping string upload because your local version (%s) is older than latest in svn (%s)" % (local_ver, latest_ver)) return strings = extract_strings_from_c_files() strings.sort() s = "AppTranslator strings\n" + string.join(strings, "\n") s = s.encode("utf8") if lastUploaded() == s: print( "Skipping upload because strings haven't changed since last upload") else: uploadStringsToServer(s, uploadsecret) saveLastUploaded(s) print("Don't forget to checkin strings/last_uploaded.txt")
def buildbot_loop(): while True: # util.get_svn_versions() might throw an exception due to # temporary network problems, so retry try: (local_ver, latest_ver) = util.get_svn_versions() except: print("get_svn_versions() threw an exception") time.sleep(120) continue print("local ver: %s, latest ver: %s" % (local_ver, latest_ver)) while int(local_ver) <= int(latest_ver): if not has_already_been_built(local_ver): build_version_try(local_ver) else: print("We have already built revision %s" % local_ver) local_ver = str(int(local_ver)+1) delete_old_logs() print("Sleeping for 15 minutes") time.sleep(60*15) # 15 mins