def UploadApiDocs(dir_name): apidocs_namer = bot_utils.GCSNamerApiDocs(CHANNEL) revision = utils.GetSVNRevision() apidocs_destination_gcsdir = apidocs_namer.docs_dirpath(revision) apidocs_destination_latestfile = apidocs_namer.docs_latestpath(revision) # Return early if the documents have already been uploaded. # (This can happen if a build was forced, or a commit had no changes in the # dart repository (e.g. DEPS file update).) if GsutilExists(apidocs_destination_gcsdir): print("Not uploading api docs, since %s is already present." % apidocs_destination_gcsdir) return # Upload everything inside the built apidocs directory. gsutil = bot_utils.GSUtil() gsutil.upload(dir_name, apidocs_destination_gcsdir, recursive=True, public=True) # Update latest.txt to contain the newest revision. with utils.TempDir('latest_file') as temp_dir: latest_file = os.path.join(temp_dir, 'latest.txt') with open(latest_file, 'w') as f: f.write('%s' % revision) DartArchiveFile(latest_file, apidocs_destination_latestfile)
def UploadApiLatestFile(): apidocs_namer = bot_utils.GCSNamerApiDocs(CHANNEL) revision = utils.GetArchiveVersion() apidocs_destination_latestfile = apidocs_namer.docs_latestpath(revision) # Update latest.txt to contain the newest revision. with utils.TempDir('latest_file') as temp_dir: latest_file = os.path.join(temp_dir, 'latest.txt') with open(latest_file, 'w') as f: f.write('%s' % revision) DartArchiveFile(latest_file, apidocs_destination_latestfile)
def UploadDartdocApiDocs(dir_name): apidocs_namer = bot_utils.GCSNamerApiDocs(CHANNEL) revision = utils.GetArchiveVersion() dartdocs_destination_gcsdir = apidocs_namer.dartdocs_dirpath(revision) # Return early if the documents have already been uploaded. # This can happen if a build was forced, or a commit had no changes in the # dart repository (e.g. DEPS file update). if GsutilExists(dartdocs_destination_gcsdir): print ("Not uploading api docs, since %s is already present." % dartdocs_destination_gcsdir) return # Upload everything inside the built apidocs directory. gsutil = bot_utils.GSUtil() gsutil.upload(dir_name, dartdocs_destination_gcsdir, recursive=True, public=True, multithread=True)