mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +08:00
Add symbol upload python script for manual symbol uploads
This commit is contained in:
committed by
Klaus Basan
parent
060c3ee492
commit
912d44d558
40
scripts/symbolupload.py
Normal file
40
scripts/symbolupload.py
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import platform
|
||||||
|
import requests
|
||||||
|
|
||||||
|
def upload_symbol_files(symbol_path, version):
|
||||||
|
print('Uploading symbols')
|
||||||
|
url = 'http://crashreports.swift-project.org/symfiles'
|
||||||
|
|
||||||
|
symbol_files = [os.path.join(root, name)
|
||||||
|
for root, dirs, files in os.walk(symbol_path)
|
||||||
|
for name in files
|
||||||
|
if name.endswith('.sym')]
|
||||||
|
|
||||||
|
for symbol_file in symbol_files:
|
||||||
|
print ('Uploading ' + symbol_file)
|
||||||
|
files = [
|
||||||
|
('symfile', open(symbol_file, 'rb')),
|
||||||
|
]
|
||||||
|
data = {'release': version}
|
||||||
|
r = requests.post(url, files=files, data=data)
|
||||||
|
r.raise_for_status()
|
||||||
|
|
||||||
|
def print_help():
|
||||||
|
print('Usage: symbolupload.py <symbol path> <version>')
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv):
|
||||||
|
print len(argv)
|
||||||
|
if len(argv) != 2:
|
||||||
|
print_help()
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
symbol_path = sys.argv[1]
|
||||||
|
version = sys.argv[2]
|
||||||
|
upload_symbol_files(symbol_path, version)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main(sys.argv[1:])
|
||||||
Reference in New Issue
Block a user