def _ArchiveGoodBuild(platform, commit_position): """Archive chromedriver binary if the build is green.""" assert platform != 'android' util.MarkBuildStepStart('archive build') server_name = 'chromedriver' if util.IsWindows(): server_name += '.exe' zip_path = util.Zip(os.path.join(chrome_paths.GetBuildDir([server_name]), server_name)) build_name = 'chromedriver_%s_%s.%s.zip' % ( platform, _GetVersion(), commit_position) build_url = '%s/%s' % (GS_CONTINUOUS_URL, build_name) if slave_utils.GSUtilCopy(zip_path, build_url): util.MarkBuildStepError() if util.IsWindows(): zip_path = util.Zip(os.path.join( chrome_paths.GetBuildDir([server_name + '.pdb']), server_name + '.pdb')) pdb_name = 'chromedriver_%s_pdb_%s.%s.zip' % ( platform, _GetVersion(), commit_position) pdb_url = '%s/%s' % (GS_CONTINUOUS_URL, pdb_name) if slave_utils.GSUtilCopy(zip_path, pdb_url): util.MarkBuildStepError() (latest_fd, latest_file) = tempfile.mkstemp() os.write(latest_fd, build_name) os.close(latest_fd) latest_url = '%s/latest_%s' % (GS_CONTINUOUS_URL, platform) if slave_utils.GSUtilCopy(latest_file, latest_url, mimetype='text/plain'): util.MarkBuildStepError() os.remove(latest_file)
def _ArchivePrebuilts(commit_position): """Uploads the prebuilts to google storage.""" util.MarkBuildStepStart('archive prebuilts') zip_path = util.Zip(os.path.join(chrome_paths.GetBuildDir(['chromedriver']), 'chromedriver')) if slave_utils.GSUtilCopy( zip_path, '%s/%s' % (GS_PREBUILTS_URL, 'r%s.zip' % commit_position)): util.MarkBuildStepError()
def _ArchiveGoodBuild(platform, revision): assert platform != 'android' util.MarkBuildStepStart('archive build') server_name = 'chromedriver' if util.IsWindows(): server_name += '.exe' zip_path = util.Zip(os.path.join(chrome_paths.GetBuildDir([server_name]), server_name)) build_url = '%s/chromedriver_%s_%s.%s.zip' % ( GS_CONTINUOUS_URL, platform, _GetVersion(), revision) if slave_utils.GSUtilCopy(zip_path, build_url): util.MarkBuildStepError()
def _Release(build, version, platform): """Releases the given candidate build.""" release_name = 'chromedriver_%s.zip' % platform util.MarkBuildStepStart('releasing %s' % release_name) temp_dir = util.MakeTempDir() slave_utils.GSUtilCopy(build, temp_dir) zip_path = os.path.join(temp_dir, os.path.basename(build)) if util.IsLinux(): util.Unzip(zip_path, temp_dir) server_path = os.path.join(temp_dir, 'chromedriver') util.RunCommand(['strip', server_path]) zip_path = util.Zip(server_path) slave_utils.GSUtilCopy( zip_path, '%s/%s/%s' % (GS_CHROMEDRIVER_BUCKET, version, release_name)) _MaybeUpdateLatestRelease(version)