Changeset 245359 in webkit
- Timestamp:
- May 15, 2019 3:21:24 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 added
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/Shared/transfer-archive-to-s3
r245358 r245359 3 3 import boto3 4 4 import os 5 import os.path6 5 import sys 7 6 8 S3_BUCKET = 'archives.webkit.org' 7 S3_DEFAULT_BUCKET = 'archives.webkit.org' 8 S3_EWS_BUCKET = 'ews-archives.webkit.org' 9 9 S3_MINIFIED_BUCKET = 'minified-archives.webkit.org' 10 10 S3_REGION_PREFIX = 'https://s3-us-west-2.amazonaws.com' … … 14 14 key = '/'.join([identifier, revision + '.zip']) 15 15 print '\tS3 Bucket: {}\n\tS3 Key: {}'.format(bucket, key) 16 s3 = boto3.client('s3') 16 17 s3.upload_file(archive_path, bucket, key) 17 18 print('\tS3 URL: {}/{}/{}'.format(S3_REGION_PREFIX, bucket, key)) … … 20 21 if archive: 21 22 if os.path.exists(archive): 22 23 return True 23 24 else: 24 25 print 'WARNING: Archive does not exist: {}'.format(archive) 25 26 return False 26 27 parser = argparse.ArgumentParser(add_help=True)28 parser.add_argument('--revision', action="store", required=True, help='Revision number for the built archive')29 parser.add_argument('--identifier', action="store", required=True, help='S3 destination identifier, in the form of fullPlatform-architecture-configuration. [mac-sierra-x86_64-release]')30 parser.add_argument('--archive', action="store", required=True, help='Path to the full size archive. [path/to/123456.zip]')31 args = parser.parse_args()32 27 28 def main(): 29 parser = argparse.ArgumentParser(add_help=True) 33 30 34 head, tail = os.path.split(str(args.archive))35 minifiedArchive = head + '/minified-' + tail 36 s3 = boto3.client('s3')31 group = parser.add_mutually_exclusive_group(required=True) 32 group.add_argument('--revision', action="store", help='Revision number or patch_id for the built archive') 33 group.add_argument('--patch_id', action="store", help='patch_id of the patch') 37 34 38 if archiveExists(args.archive): 39 uploadToS3(args.archive, S3_BUCKET, args.identifier, args.revision) 40 if archiveExists(minifiedArchive): 41 uploadToS3(minifiedArchive, S3_MINIFIED_BUCKET, args.identifier, args.revision) 35 parser.add_argument('--identifier', action="store", required=True, help='S3 destination identifier, in the form of fullPlatform-architecture-configuration. [mac-mojave-x86_64-release]') 36 parser.add_argument('--archive', action="store", required=True, help='Path to the full size archive. [path/to/123456.zip]') 37 args = parser.parse_args() 38 39 parentdir, filename = os.path.split(str(args.archive)) 40 minifiedArchive = os.path.join(parentdir, 'minified-' + filename) 41 42 s3_bucket = S3_DEFAULT_BUCKET 43 if args.patch_id: 44 s3_bucket = S3_EWS_BUCKET 45 46 if archiveExists(args.archive): 47 uploadToS3(args.archive, s3_bucket, args.identifier, args.revision or args.patch_id) 48 if not args.patch_id and archiveExists(minifiedArchive): 49 uploadToS3(minifiedArchive, S3_MINIFIED_BUCKET, args.identifier, args.revision) 50 51 if __name__ == "__main__": 52 main() -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py
r240187 r245359 875 875 identifier = WithProperties("%(fullPlatform)s-%(architecture)s-%(configuration)s") 876 876 revision = WithProperties("%(got_revision)s") 877 command = ["python", ". /transfer-archive-to-s3", "--revision", revision, "--identifier", identifier, "--archive", archive]877 command = ["python", "../Shared/transfer-archive-to-s3", "--revision", revision, "--identifier", identifier, "--archive", archive] 878 878 haltOnFailure = True 879 879 -
trunk/Tools/ChangeLog
r245338 r245359 1 2019-05-15 Aakash Jain <aakash_jain@apple.com> 2 3 [ews-build] Enabling uploading EWS archives to S3 4 https://bugs.webkit.org/show_bug.cgi?id=197914 5 6 Reviewed by Jonathan Bedard. 7 8 * BuildSlaveSupport/Shared: Added. 9 * BuildSlaveSupport/Shared/transfer-archive-to-s3: Moved from Tools/BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3. 10 (archiveExists): Replace tab with space. 11 (main): Added main method. 12 * BuildSlaveSupport/build.webkit.org-config/steps.py: 13 (TransferToS3): Updated path to the script. 14 * BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3: Moved to Shared folder. 15 1 16 2019-05-15 Wenson Hsieh <wenson_hsieh@apple.com> 2 17
Note: See TracChangeset
for help on using the changeset viewer.