thrust 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4af4e735542bbbc21050f9b8f23a081eb3132c93
4
- data.tar.gz: 087eaad19b5bbfbd21346b8fcd6f63a94e63bf41
3
+ metadata.gz: 49104e9b67fae157899bc8c13c55d9f05de51639
4
+ data.tar.gz: 30e80bbd2a0dfa458347b2d04f4b3ad3a3c82028
5
5
  SHA512:
6
- metadata.gz: 7276e115badf2322966be2f3b1dbd3f395dd99a654b7579b38745c65cff6b08b4522c7fcfa152ce4a9c38d2ed42d039698caf470378539f925d29f2d2fffd6b2
7
- data.tar.gz: 77bef75792b11abc24117e6101c488b08f10c44c15e3989ea435dfd6ca5ee7160c15bbd5e64c90111e7563554e95cb925a71920c2a8b1bae234593a012f7a9f5
6
+ metadata.gz: ca03bbb26bf562bc0354f0a93568f416dab0a95e141d2bdb92b30d0e453e6ca04cd5bd7b8fc5ffb439a64657aa8e8594fe4da5d621d827f5d8005c6227451f30
7
+ data.tar.gz: 188c251925c482ac4a81050cb007558f8d4d66d340ab89aa65d1b606347a15ee408d643bd0b78a35859591abd19a58c22300444e416a3fd6a9fc5fc51a7d64d9
@@ -1,4 +1,4 @@
1
- thrust_version: 0.6
1
+ thrust_version: 0.7
2
2
  project_name: My Great Project # do not use if building with an xcode workspace
3
3
  # workspace_name: My Workspace # use if building with an xcode workspace
4
4
  # path_to_xcodeproj: 'App/MyApp.xcodeproj' # use if xcodeproj is not in the same directory as this yaml file. Optional.
@@ -6,15 +6,8 @@ app_name: My Great App
6
6
  distribution_certificate: 'Name of Distribution Signing Certificate'
7
7
  #ios_sim_path: '/path/to/ios-sim' # Optional. Use to prefer a specific ios-sim binary (e.g. within project directory) over a system-installed version (homebrew)
8
8
 
9
- testflight:
10
- api_token: 'testflight api token' # To find your App Token, follow the instructions at: http://help.testflightapp.com/customer/portal/articles/829956-what-does-the-api-token-do-
11
- team_token: 'testflight team token' # To find your Team Token, follow the instructions at: http://help.testflightapp.com/customer/portal/articles/829942-how-do-i-find-my-team-token-
12
-
13
9
  deployment_targets:
14
10
  staging:
15
- distribution_list: Developers # This is the name of a TestFlight distribution list
16
- notify: true # Whether to notify people on the distribution list about this deployment
17
- note_generation_method: autotag # If you set this value, it will auto-generate the deploy notes from the commit history. Optional.
18
11
  target: MyGreatAppTarget # Name of the build target. Optional, defaults to app name.
19
12
  build_configuration: Release
20
13
  provisioning_search_query: 'query to find Provisioning Profile' # Otherwise, it will use the first provisioning profile in ~/Library/MobileDevice/Provisioning Profiles/
@@ -22,8 +15,6 @@ deployment_targets:
22
15
  tag: ci # Deploys latest commit with the tag. Leave blank to deploy from master.
23
16
 
24
17
  demo:
25
- distribution_list: Beta Testers
26
- notify: true
27
18
  build_configuration: Demo
28
19
  provisioning_search_query: 'query to find Provisioning Profile'
29
20
 
@@ -3,8 +3,9 @@ require_relative '../thrust'
3
3
  @app_config = Thrust::ConfigLoader.load_configuration(Dir.getwd, File.join(Dir.getwd, 'thrust.yml'))
4
4
 
5
5
  namespace :autotag do
6
- task :create, :stage do |_, args|
7
- Thrust::Tasks::Autotag::Create.new.run(args[:stage])
6
+ desc 'Create a tag for the given deployment environment'
7
+ task :create, :environment do |_, args|
8
+ Thrust::Tasks::Autotag::Create.new.run(args[:environment])
8
9
  end
9
10
 
10
11
  desc 'Show the commit that is currently deployed to each environment'
@@ -2,11 +2,11 @@ require_relative '../thrust'
2
2
 
3
3
  @app_config = Thrust::ConfigLoader.load_configuration(Dir.getwd, File.join(Dir.getwd, 'thrust.yml'))
4
4
 
5
- namespace :testflight do
5
+ namespace :build_ipa do
6
6
  @app_config.deployment_targets.each do |task_name, deployment_config|
7
- desc "Deploy iOS build to #{task_name} (use NOTIFY=false to prevent team notification)"
7
+ desc "Build an .ipa file for deployment to #{task_name}"
8
8
  task task_name do |_, _|
9
- Thrust::DeployProvider.new.instance(@app_config, deployment_config, task_name).run
9
+ Thrust::IPABuilderProvider.new.instance(@app_config, deployment_config, task_name).run
10
10
  end
11
11
  end
12
12
  end
@@ -2,13 +2,12 @@ require 'thrust/config_loader'
2
2
  require 'thrust/executor'
3
3
  require 'thrust/execution_helper'
4
4
  require 'thrust/git'
5
- require 'thrust/testflight'
6
5
  require 'thrust/user_prompt'
7
6
  require 'thrust/agv_tool'
8
7
  require 'thrust/ios_spec_launcher'
9
8
  require 'thrust/osx_spec_launcher'
10
- require 'thrust/deploy'
11
- require 'thrust/deploy_provider'
9
+ require 'thrust/ipa_builder'
10
+ require 'thrust/ipa_builder_provider'
12
11
  require 'thrust/xcode_tools'
13
12
  require 'thrust/xcode_tools_provider'
14
13
  require 'thrust/scheme_parser'
@@ -1,6 +1,5 @@
1
1
  require_relative 'deployment_target'
2
2
  require_relative 'spec_target'
3
- require_relative 'testflight_credentials'
4
3
 
5
4
  module Thrust
6
5
  class AppConfig
@@ -10,7 +9,6 @@ module Thrust
10
9
  :ios_sim_path,
11
10
  :spec_targets,
12
11
  :project_name,
13
- :testflight,
14
12
  :thrust_version,
15
13
  :workspace_name,
16
14
  :path_to_xcodeproj,
@@ -28,7 +26,6 @@ module Thrust
28
26
  @spec_targets = generate_spec_targets(attributes['spec_targets'])
29
27
  @spec_directories = generate_spec_directories(attributes['spec_directories'])
30
28
  @project_name = attributes['project_name']
31
- @testflight = generate_testflight_credentials(attributes['testflight'])
32
29
  @thrust_version = attributes['thrust_version'].to_s
33
30
  @workspace_name = attributes['workspace_name']
34
31
  @path_to_xcodeproj = attributes['path_to_xcodeproj']
@@ -61,11 +58,5 @@ module Thrust
61
58
  existing
62
59
  end
63
60
  end
64
-
65
- def generate_testflight_credentials(testflight_credentials_hash)
66
- return if testflight_credentials_hash.nil?
67
-
68
- TestflightCredentials.new(testflight_credentials_hash)
69
- end
70
61
  end
71
62
  end
@@ -9,7 +9,7 @@ module Thrust
9
9
  class MalformedConfigError < ConfigError ; end
10
10
  class InvalidVersionConfigError < ConfigError ; end
11
11
 
12
- THRUST_VERSION = '0.6'
12
+ THRUST_VERSION = '0.7'
13
13
 
14
14
  def self.load_configuration(relative_project_root, config_file, out = STDERR)
15
15
  begin
@@ -1,11 +1,10 @@
1
1
  module Thrust
2
- class Deploy
3
- def initialize(out, xcode_tools, agv_tool, git, testflight, app_config, deployment_config, deployment_target)
2
+ class IPABuilder
3
+ def initialize(out, xcode_tools, agv_tool, git, app_config, deployment_config, deployment_target)
4
4
  @out = out
5
5
  @xcode_tools = xcode_tools
6
6
  @agv_tool = agv_tool
7
7
  @git = git
8
- @testflight = testflight
9
8
  @app_config = app_config
10
9
  @deployment_config = deployment_config
11
10
  @deployment_target = deployment_target
@@ -32,14 +31,11 @@ module Thrust
32
31
 
33
32
  ipa_file = @xcode_tools.cleanly_create_ipa(target, app_name, @app_config.distribution_certificate, @deployment_config.provisioning_search_query)
34
33
 
35
- dsym_path = "#{@xcode_tools.build_configuration_directory}/#{app_name}.app.dSYM"
36
- dsym_path = nil unless File.exist?(dsym_path)
37
-
38
- autogenerate_notes = @deployment_config.note_generation_method == 'autotag'
39
- @testflight.upload(ipa_file, @deployment_config.notify, @deployment_config.distribution_list, autogenerate_notes, @deployment_target, dsym_path)
40
-
41
- @git.create_tag(@deployment_target)
42
34
  @git.reset
35
+
36
+ @out.puts "\n\n"
37
+ @out.puts "Successfully built .ipa:".green
38
+ @out.puts ipa_file
43
39
  rescue Exception => e
44
40
  @out.puts "\n\n"
45
41
  @out.puts e.message.red
@@ -1,5 +1,5 @@
1
1
  module Thrust
2
- class DeployProvider
2
+ class IPABuilderProvider
3
3
  def instance(app_config, deployment_config, deployment_target)
4
4
  stdout = $stdout
5
5
  thrust_executor = Thrust::Executor.new
@@ -8,10 +8,8 @@ module Thrust
8
8
  xcode_tools = Thrust::XcodeToolsProvider.new.instance(stdout, build_configuration, app_config.build_directory, tools_options)
9
9
  git = Thrust::Git.new(stdout, thrust_executor)
10
10
  agv_tool = Thrust::AgvTool.new(thrust_executor, git)
11
- testflight_config = app_config.testflight
12
- testflight = Thrust::Testflight.new(thrust_executor, stdout, $stdin, testflight_config.api_token, testflight_config.team_token)
13
11
 
14
- Thrust::Deploy.new(stdout, xcode_tools, agv_tool, git, testflight, app_config, deployment_config, deployment_target)
12
+ Thrust::IPABuilder.new(stdout, xcode_tools, agv_tool, git, app_config, deployment_config, deployment_target)
15
13
  end
16
14
  end
17
15
  end
@@ -1,4 +1,4 @@
1
1
  load File.expand_path('../../tasks/cedar.rake', __FILE__)
2
2
  load File.expand_path('../../tasks/autotag.rake', __FILE__)
3
- load File.expand_path('../../tasks/testflight.rake', __FILE__)
4
3
  load File.expand_path('../../tasks/version.rake', __FILE__)
4
+ load File.expand_path('../../tasks/build_ipa.rake', __FILE__)
@@ -125,6 +125,7 @@ module Thrust
125
125
  ].join(' ')
126
126
  @thrust_executor.system_or_exit(package_command)
127
127
 
128
+ @thrust_executor.system_or_exit("rm -rf #{build_configuration_directory}/Payload")
128
129
  @thrust_executor.system_or_exit("cd '#{build_configuration_directory}' && unzip '#{app_name}.ipa'")
129
130
  @thrust_executor.system_or_exit("/usr/bin/codesign --verify --force --preserve-metadata=identifier,entitlements --sign '#{signing_identity}' '#{build_configuration_directory}/Payload/#{app_name}.app'")
130
131
  @thrust_executor.system_or_exit("cd '#{build_configuration_directory}' && zip -qr '#{app_name}.ipa' 'Payload'")
@@ -153,7 +154,7 @@ module Thrust
153
154
  end
154
155
 
155
156
  def project_or_workspace_flag
156
- @workspace_name ? "-workspace #{@workspace_name}.xcworkspace" : "-project #{@project_name}.xcodeproj"
157
+ @workspace_name ? "-workspace \"#{@workspace_name}.xcworkspace\"" : "-project \"#{@project_name}.xcodeproj\""
157
158
  end
158
159
  end
159
160
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thrust
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Levine
@@ -27,7 +27,7 @@ authors:
27
27
  autorequire:
28
28
  bindir: bin
29
29
  cert_chain: []
30
- date: 2015-01-29 00:00:00.000000000 Z
30
+ date: 2015-02-27 00:00:00.000000000 Z
31
31
  dependencies:
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: colorize
@@ -77,14 +77,14 @@ dependencies:
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: 2.4.0
80
+ version: '2.4'
81
81
  type: :runtime
82
82
  prerelease: false
83
83
  version_requirements: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: 2.4.0
87
+ version: '2.4'
88
88
  - !ruby/object:Gem::Dependency
89
89
  name: fakefs
90
90
  requirement: !ruby/object:Gem::Requirement
@@ -128,8 +128,8 @@ dependencies:
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0.7'
130
130
  description: Thrust provides a collection of rake tasks for iOS projects. These include
131
- tasks for running Cedar test suites and for deploying iOS apps to Testflight.
132
- email: edellapenna@pivotal.io
131
+ tasks for running Cedar test suites and for building iOS app archives for deployment.
132
+ email: avonderhaar@pivotal.io
133
133
  executables:
134
134
  - thrust
135
135
  extensions: []
@@ -138,21 +138,21 @@ files:
138
138
  - bin/thrust
139
139
  - lib/config/thrust_example.yml
140
140
  - lib/tasks/autotag.rake
141
+ - lib/tasks/build_ipa.rake
141
142
  - lib/tasks/cedar.rake
142
- - lib/tasks/testflight.rake
143
143
  - lib/tasks/version.rake
144
144
  - lib/thrust.rb
145
145
  - lib/thrust/agv_tool.rb
146
146
  - lib/thrust/app_config.rb
147
147
  - lib/thrust/cedar_results_parser.rb
148
148
  - lib/thrust/config_loader.rb
149
- - lib/thrust/deploy.rb
150
- - lib/thrust/deploy_provider.rb
151
149
  - lib/thrust/deployment_target.rb
152
150
  - lib/thrust/execution_helper.rb
153
151
  - lib/thrust/executor.rb
154
152
  - lib/thrust/git.rb
155
153
  - lib/thrust/ios_spec_launcher.rb
154
+ - lib/thrust/ipa_builder.rb
155
+ - lib/thrust/ipa_builder_provider.rb
156
156
  - lib/thrust/osx_spec_launcher.rb
157
157
  - lib/thrust/scheme_parser.rb
158
158
  - lib/thrust/spec_target.rb
@@ -164,8 +164,6 @@ files:
164
164
  - lib/thrust/tasks/nof.rb
165
165
  - lib/thrust/tasks/spec_runner.rb
166
166
  - lib/thrust/tasks/trim.rb
167
- - lib/thrust/testflight.rb
168
- - lib/thrust/testflight_credentials.rb
169
167
  - lib/thrust/user_prompt.rb
170
168
  - lib/thrust/xcode_tools.rb
171
169
  - lib/thrust/xcode_tools_provider.rb
@@ -194,4 +192,3 @@ signing_key:
194
192
  specification_version: 4
195
193
  summary: Thrust is a collection of rake tasks for iOS development and deployment
196
194
  test_files: []
197
- has_rdoc:
@@ -1,49 +0,0 @@
1
- module Thrust
2
- class Testflight
3
- UploadFailed = Class.new(StandardError)
4
-
5
- def initialize(thrust_executor, out, input, api_token, team_token)
6
- @thrust_executor = thrust_executor
7
- @out = out
8
- @in = input
9
- @git = Thrust::Git.new(@out, @thrust_executor)
10
- @api_token = api_token
11
- @team_token = team_token
12
- end
13
-
14
- def upload(package_file, notify, distribution_list, autogenerate_deploy_notes, deployment_target, dsym_path = nil)
15
- if dsym_path
16
- @out.puts 'Zipping dSYM...'
17
- zipped_dsym_path = "#{dsym_path}.zip"
18
- @thrust_executor.system_or_exit "zip -r -T -y '#{zipped_dsym_path}' '#{dsym_path}'"
19
- @out.puts 'Done!'
20
- end
21
-
22
- if autogenerate_deploy_notes
23
- message_file_path = @git.generate_notes_for_deployment(deployment_target)
24
- else
25
- message_file_path = Thrust::UserPrompt.get_user_input('Deploy Notes: ', @out, @in)
26
- end
27
-
28
- @out.puts 'Uploading to TestFlight...'.green
29
-
30
- testflight_response = @thrust_executor.capture_output_from_system(['curl -sw "thrust_testflight_status_code:%{http_code}" http://testflightapp.com/api/builds.json',
31
- "-F file=@#{package_file}",
32
- ("-F dsym=@#{zipped_dsym_path}" if dsym_path),
33
- "-F api_token='#{(ENV['TESTFLIGHT_API_TOKEN'] || @api_token)}'",
34
- "-F team_token='#{@team_token}'",
35
- "-F notes=@#{message_file_path}",
36
- "-F notify=#{(ENV['NOTIFY'] || notify).to_s.downcase.capitalize}",
37
- ("-F distribution_lists='#{distribution_list}'" if distribution_list)
38
- ].compact.join(' '))
39
-
40
- status_code = testflight_response.match(/thrust_testflight_status_code:(\d+)/).captures.first
41
- if status_code.to_i >= 400
42
- error_message = testflight_response.gsub(/thrust_testflight_status_code:(\d+)/, '')
43
- raise(UploadFailed, "******** Upload Failed: #{error_message} ********")
44
- else
45
- @out.puts 'Finished uploading to TestFlight'.green
46
- end
47
- end
48
- end
49
- end
@@ -1,11 +0,0 @@
1
- module Thrust
2
- class TestflightCredentials
3
- attr_reader :api_token,
4
- :team_token
5
-
6
- def initialize(attributes)
7
- @api_token = attributes['api_token']
8
- @team_token = attributes['team_token']
9
- end
10
- end
11
- end