Добавил возможность публикации в testflight
This commit is contained in:
parent
dcf99979b3
commit
6e7135fb35
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import imp
|
||||
|
||||
import settings
|
||||
import instruments
|
||||
|
|
@ -42,4 +43,13 @@ for bc in build_ready_configs:
|
|||
instruments.BuildSolution(bc['mdtool'], sln_path, bc['sln_config'])
|
||||
|
||||
instruments.CreateOrRestoreFromBackup(sln_dir, bc['files_for_backup'])
|
||||
instruments.DeleteBackups(sln_dir, bc['files_for_backup'])
|
||||
instruments.DeleteBackups(sln_dir, bc['files_for_backup'])
|
||||
|
||||
if 'post_build_file' in bc and 'post_build_actions' in bc:
|
||||
path_to_script = bc['post_build_file']
|
||||
module_name = os.path.splitext(os.path.basename(path_to_script))[0]
|
||||
post_build = imp.load_source(module_name, path_to_script)
|
||||
|
||||
for func_name in bc['post_build_actions']:
|
||||
func = getattr(post_build, func_name)
|
||||
func(bc)
|
||||
|
|
@ -1,8 +1,20 @@
|
|||
from subprocess import call
|
||||
import os
|
||||
import testflight
|
||||
|
||||
def PublishToTestFlight(config):
|
||||
sln_path = config['sln_path']
|
||||
sln_dir = os.path.dirname(sln_path)
|
||||
|
||||
cmd_text_pattern = "curl http://testflightapp.com/api/builds.json -F file=@'{0}' -F api_token='{1}' -F team_token='{2}' -F notes='This build was uploaded via the upload API'"
|
||||
cmd_text = cmd_text_pattern.format(config[''])
|
||||
ipa_rel_path = 'BuildSample/bin/iPhone/Release/BuildSample-{0}.ipa'.format(config['version'])
|
||||
ipa_abs_path = os.path.join(sln_dir, ipa_rel_path)
|
||||
|
||||
api_token = config['api_token']
|
||||
team_token = config['team_token']
|
||||
cmd_text = cmd_text_pattern.format(ipa_abs_path, api_token, team_token)
|
||||
|
||||
ret_code = call(cmd_text, shell=True)
|
||||
|
||||
def PrintToConsole(config):
|
||||
print 'Sample post build action!'
|
||||
|
|
@ -10,6 +10,8 @@ build_root = {
|
|||
|
||||
ios_root = {
|
||||
'sln_path' : '/Users/rzaitov/Documents/Apps/BuildScript/BuildSample/BuildSample.sln',
|
||||
'api_token': '0e6925075d4fc10fed0e7bbf43fa6894_NjQ0OTI2MjAxMi0wOS0yNSAxMTo0MDozNi40OTY5MjU',
|
||||
'team_token': 'c5c3cf7a6dae2bea4382dfbd181a2075_Mjc4ODkwMjAxMy0wOS0yOSAxNDowOTo1OC40Mzg5MTY',
|
||||
'parent' : build_root
|
||||
}
|
||||
|
||||
|
|
@ -19,7 +21,7 @@ ios_development_root = {
|
|||
'info_plist_rel_path': 'BuildSample/Info.plist',
|
||||
|
||||
'post_build_file': 'post_build.py',
|
||||
'post_build_actions' : ['PublishToTestFlight', 'PrintToConsole'],
|
||||
'post_build_actions' : ['PrintToConsole', 'PublishToTestFlight'],
|
||||
|
||||
'patch': patch.PathcIos,
|
||||
'parent': ios_root
|
||||
|
|
|
|||
Loading…
Reference in New Issue