From 3c8dd437ce0bf935f1fe6d9a1137efcd1b8d46bd Mon Sep 17 00:00:00 2001 From: Rustam Zaitov Date: Mon, 30 Sep 2013 22:01:06 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BF=D1=80=D0=BE=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BF=D1=83=D0=B1=D0=BB=D0=B8=D0=BA=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8E=20=D0=B2=20tf=20=D1=81=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=D0=BC=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/post_build.py | 8 ++------ scripts/settings.py | 7 +++++-- scripts/testflight.py | 14 ++++++++++---- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/scripts/post_build.py b/scripts/post_build.py index 057ba01..53e6b34 100644 --- a/scripts/post_build.py +++ b/scripts/post_build.py @@ -1,12 +1,8 @@ import testflight as tf def PublishToTestFlight(config): - api_token = config['api_token'] - team_token = config['team_token'] - - publisher = tf.TestFlightPublisher(api_token, team_token) - publisher.Publish(config) - + publisher = tf.TestFlightPublisher(config) + publisher.Publish() def PrintToConsole(config): print 'Sample post build action!' \ No newline at end of file diff --git a/scripts/settings.py b/scripts/settings.py index 6cede79..c0a4cdb 100644 --- a/scripts/settings.py +++ b/scripts/settings.py @@ -10,8 +10,11 @@ build_root = { ios_root = { 'sln_path' : '/Users/rzaitov/Documents/Apps/BuildScript/BuildSample/BuildSample.sln', - 'api_token': '0e6925075d4fc10fed0e7bbf43fa6894_NjQ0OTI2MjAxMi0wOS0yNSAxMTo0MDozNi40OTY5MjU', - 'team_token': 'c5c3cf7a6dae2bea4382dfbd181a2075_Mjc4ODkwMjAxMy0wOS0yOSAxNDowOTo1OC40Mzg5MTY', + + 'tf_api_token': '0e6925075d4fc10fed0e7bbf43fa6894_NjQ0OTI2MjAxMi0wOS0yNSAxMTo0MDozNi40OTY5MjU', + 'tf_team_token': 'c5c3cf7a6dae2bea4382dfbd181a2075_Mjc4ODkwMjAxMy0wOS0yOSAxNDowOTo1OC40Mzg5MTY', + 'ft_notes': 'This build was uploaded via the upload API', + 'parent' : build_root } diff --git a/scripts/testflight.py b/scripts/testflight.py index 94611ff..980f960 100644 --- a/scripts/testflight.py +++ b/scripts/testflight.py @@ -17,14 +17,20 @@ class TestFlightPublisherBase: return ret_code class TestFlightPublisher(TestFlightPublisherBase): - def __init__(self, api_token, team_token, notes=TestFlightPublisherBase.DefaultNotes): + def __init__(self, config): + self._config = config + + api_token = config['tf_api_token'] + team_token = config['tf_team_token'] + notes = config.get('ft_notes', None) + TestFlightPublisherBase.__init__(self, api_token, team_token, notes) - def Publish(self, config): - sln_path = config['sln_path'] + def Publish(self): + sln_path = self._config['sln_path'] sln_dir = os.path.dirname(sln_path) - ipa_rel_path = 'BuildSample/bin/iPhone/Release/BuildSample-{0}.ipa'.format(config['version']) + ipa_rel_path = 'BuildSample/bin/iPhone/Release/BuildSample-{0}.ipa'.format(self._config['version']) ipa_abs_path = os.path.join(sln_dir, ipa_rel_path) return TestFlightPublisherBase.Publish(self, ipa_abs_path) \ No newline at end of file