def testChromeCommitPositionDepthTwo(self): self.mockDepthTwoGitCommand() result = build_version.ChromeCommitPosition() self.assertEqual( result, '6a8b61d6be4656e682eba005a1dd7f129789129c-refs/heads/master@{#292480}' )
def UploadArchives(): major_version = build_version.ChromeMajorVersion() chrome_revision = build_version.ChromeRevision() commit_position = build_version.ChromeCommitPosition() git_sha = build_version.ParseCommitPosition(commit_position)[0] short_sha = git_sha[:9] archive_version = '%s-%s-%s' % (major_version, chrome_revision, short_sha) bucket_path = 'native-client-sdk/archives/%s' % archive_version for archive_name in all_archives: buildbot_common.Archive(archive_name, bucket_path, cwd=BUILD_ARCHIVE_DIR, step_link=False) sha1_filename = archive_name + '.sha1' buildbot_common.Archive(sha1_filename, bucket_path, cwd=BUILD_ARCHIVE_DIR, step_link=False)
def MakeVersionJson(): time_format = '%Y/%m/%d %H:%M:%S' data = { 'chrome_version': build_version.ChromeVersionNoTrunk(), 'chrome_revision': build_version.ChromeRevision(), 'chrome_commit_position': build_version.ChromeCommitPosition(), 'nacl_revision': build_version.NaClRevision(), 'build_date': datetime.datetime.now().strftime(time_format)} dirname = os.path.dirname(VERSION_JSON) if not os.path.exists(dirname): buildbot_common.MakeDir(dirname) with open(VERSION_JSON, 'w') as outf: json.dump(data, outf, indent=2, separators=(',', ': '))
def BuildStepCopyTextFiles(pepperdir, pepper_ver, chrome_revision, nacl_revision): buildbot_common.BuildStep('Add Text Files') InstallFiles(SDK_SRC_DIR, pepperdir, TEXT_FILES) # Replace a few placeholders in README readme_text = open(os.path.join(SDK_SRC_DIR, 'README')).read() readme_text = readme_text.replace('${VERSION}', pepper_ver) readme_text = readme_text.replace('${CHROME_REVISION}', chrome_revision) readme_text = readme_text.replace('${CHROME_COMMIT_POSITION}', build_version.ChromeCommitPosition()) readme_text = readme_text.replace('${NACL_REVISION}', nacl_revision) # Year/Month/Day Hour:Minute:Second time_format = '%Y/%m/%d %H:%M:%S' readme_text = readme_text.replace('${DATE}', datetime.datetime.now().strftime(time_format)) open(os.path.join(pepperdir, 'README'), 'w').write(readme_text)