dpl 1.8.46.travis.2418.5 → 1.8.46.travis.2444.5

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
  SHA256:
3
- metadata.gz: b69e8a94ca184e73664bac4f718cac6e452b0197b44a26a8a641222f81e22f14
4
- data.tar.gz: c101fc9d0f5b4ac7d3d151ad00de98aac18b3d4dc76fcef18cf48441625dfc2c
3
+ metadata.gz: 4f3b30584a77e5baacef99591ecf51e304b1ed4c264110828ce607e8119787c8
4
+ data.tar.gz: 79b0eace9dc64bea95e735a5dcd0363f736cc4ad9e033e76e04ec4cf65f2f8f6
5
5
  SHA512:
6
- metadata.gz: 748ce41e57ed44a3e28d0c4e21757b24312296c9dca68469a6e0f15e473f4337b055db3f5c36da44dd27230a4f25b3352e9e14499afd18f9c41fcf4e47153d07
7
- data.tar.gz: f1daa961458f87d98ff49ed753186446e9ec9d8c7adeabe3a5fca1c0ef3ee129f4eee04bb9bf39fb349d390a86e345540fc02521f6222b3c2550c505bfd1ef27
6
+ metadata.gz: 990c3a6936b3e6943eb3b7cd6e46b03e57e032967d6f18eec19b5ee947fb67b60f48845f287b1bf03d2436e682251d083b554f17b8d6ee48b003de35806b425a
7
+ data.tar.gz: 1175a06901503a46076f1f80570a98cc964b9e101cd0d9c3adc0b8ff41ea2d1c09f8583fef864ac67a4118f903ddadda640c4c9d53a17cc78784a9530fd5281d
File without changes
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Writing and Testing a New Deployment Provider and new functionality
4
4
 
5
- See [TESTING.md](TESTING.md).
5
+ See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
6
6
 
7
7
  ## Supported Providers:
8
8
  Dpl supports the following providers:
@@ -780,9 +780,6 @@ and your testers can start testing your app.
780
780
  * **api-key**: TestFairy API Key (https://app.testfairy.com/settings/) run "travis encrypt --add deploy.api-key" on your repo.
781
781
  * **app-file**: Path to the app file that will be generated after the build (APK/IPA).
782
782
  * **symbols-file**: Path to the symbols file.
783
- * **keystore-file**: Path to your keystore-file (must, only for android). http://docs.travis-ci.com/user/encrypting-files/
784
- * **storepass**: storepass (must, only for android).
785
- * **alias**: alias (must, only for android).
786
783
  * **testers-groups**: You can set a tester group to be notified about this build (group1,group1).
787
784
  * **notify**: If true, an email you a changelog will be sent to your users.
788
785
  * **auto-update**: If true, all the previous installations of this app will be automatically all upgraded to this version.
@@ -7,20 +7,16 @@ module DPL
7
7
  require "net/http"
8
8
  require 'net/http/post/multipart'
9
9
  require 'json'
10
- require 'tempfile'
11
10
 
12
11
 
13
- VERSION = "0.1"
12
+ VERSION = "0.2"
14
13
  TAG = "-TestFairy-"
15
14
  SERVER = "http://api.testfairy.com"
16
15
  UPLOAD_URL_PATH = "/api/upload";
17
- UPLOAD_SIGNED_URL_PATH = "/api/upload-signed";
18
16
 
19
17
  def check_auth
20
- if android?
21
- storepassToPrint = option(:storepass).clone
22
- aliasToPrint = option(:alias).clone
23
- puts "keystore-file = #{option(:keystore_file)} storepass = #{storepassToPrint.sub! storepassToPrint[1..-2], '****'} alias = #{aliasToPrint.sub! aliasToPrint[1..-2], '****'}"
18
+ if !options[:app_file]
19
+ error 'App file is missing'
24
20
  end
25
21
  puts "api-key = #{option(:api_key).gsub(/[123456789]/, '*')} symbols-file = #{options[:symbols_file]}"
26
22
  end
@@ -32,12 +28,6 @@ module DPL
32
28
  def push_app
33
29
  puts "push_app #{TAG}"
34
30
  response = upload_app
35
- if android?
36
- puts response['instrumented_url']
37
- instrumentedFile = download_from_url response['instrumented_url']
38
- signedApk = signing_apk instrumentedFile
39
- response = upload_signed_apk signedApk
40
- end
41
31
  puts "Upload success!, check your build on #{response['build_url']}"
42
32
  end
43
33
 
@@ -48,66 +38,12 @@ module DPL
48
38
 
49
39
  private
50
40
 
51
- def signing_apk(instrumentedFile)
52
- signed = Tempfile.new(['instrumented-signed', '.apk'])
53
- zipOutput = %x[#{zip_path} -qd #{instrumentedFile} META-INF/*]
54
- if zipOutput.include? 'error'
55
- raise Error, zipOutput
56
- end
57
-
58
- jarSignerOutput = %x[#{jarsigner_path} -keystore #{option(:keystore_file)} -storepass #{option(:storepass)} -digestalg SHA1 -sigalg MD5withRSA #{instrumentedFile} #{option(:alias)}]
59
- if jarSignerOutput.include? 'error'
60
- raise Error, jarSignerOutput
61
- end
62
-
63
- verifyOutput = %x[#{jarsigner_path} -verify #{instrumentedFile}]
64
- if !verifyOutput.include? 'jar verified'
65
- raise Error, verifyOutput
66
- end
67
-
68
- zipAlignOutput = %x[#{zipalign_path} -f 4 #{instrumentedFile} #{signed.path}]
69
-
70
- puts "signing Apk finished: #{signed.path()} (file size:#{File.size(signed.path())} )"
71
- signed.path()
72
- end
73
-
74
- def download_from_url(url)
75
- puts "downloading from #{url} "
76
- url = "#{url}?api_key=#{option(:api_key)}"
77
- uri = URI.parse(url)
78
- instrumentedFile = Net::HTTP.start(uri.host, uri.port) do |http|
79
- resp = http.get "#{uri.path}?#{uri.query}"
80
- if resp.code == "302"
81
- resp = Net::HTTP.get_response(URI.parse(resp.header['location']))
82
- end
83
- file = Tempfile.new(['instrumented', '.apk'])
84
- file.write(resp.body)
85
- file.flush
86
- file
87
- end
88
- puts "Done #{instrumentedFile.path()} (file size:#{File.size(instrumentedFile.path())} )"
89
- instrumentedFile.path()
90
- end
91
-
92
41
  def upload_app
93
42
  uploadUrl = SERVER + UPLOAD_URL_PATH
94
43
  params = get_params
95
44
  post uploadUrl, params
96
45
  end
97
46
 
98
- def upload_signed_apk apkPath
99
- uploadSignedUrl = SERVER + UPLOAD_SIGNED_URL_PATH
100
-
101
- params = {"api_key" => "#{option(:api_key)}"}
102
- add_file_param params , 'apk_file', apkPath
103
- add_file_param params, 'symbols_file', options[:symbols_file]
104
- add_param params, 'testers-groups', options[:testers_groups]
105
- add_boolean_param params, 'notify', options[:notify]
106
- add_boolean_param params, 'auto-update', options[:auto_update]
107
-
108
- post uploadSignedUrl, params
109
- end
110
-
111
47
  def post url, params
112
48
  puts "Upload parameters = #{get_printable_params params} \nto #{url}"
113
49
  uri = URI.parse(url)
@@ -138,13 +74,12 @@ module DPL
138
74
  add_param params, 'screenshot-interval', options[:screenshot_interval]
139
75
  add_param params, 'max-duration', options[:max_duration]
140
76
  add_param params, 'testers-groups', options[:testers_groups]
141
- add_param params, 'advanced-options', options[:advanced_options]
142
77
  add_param params, 'metrics', options[:metrics]
143
78
  add_boolean_param params, 'data-only-wifi', options[:data_only_wifi]
144
79
  add_boolean_param params, 'record-on-background', options[:record_on_background]
145
80
  add_boolean_param params, 'video', options[:video]
146
81
  add_boolean_param params, 'notify', options[:notify]
147
- add_boolean_param params, 'icon-watermark', options[:icon_watermark]
82
+ add_boolean_param params, 'auto-update', options[:auto_update]
148
83
 
149
84
  travisCommitRange = context.env.fetch('TRAVIS_COMMIT_RANGE',nil)
150
85
  if !travisCommitRange.nil?
@@ -171,20 +106,6 @@ module DPL
171
106
  params[paramName] = (param == true) ? "on" : "off"
172
107
  end
173
108
  end
174
-
175
- def zip_path
176
- @zip_path ||= %x[which zip].split("\n").first
177
- end
178
-
179
- def zipalign_path
180
- android_home_path = context.env.fetch('ANDROID_HOME', '/usr')
181
- @zipalign_path ||= %x[find -L #{android_home_path} -name zipalign 2>/dev/null].split("\n").first
182
- end
183
-
184
- def jarsigner_path
185
- java_home_path = context.env.fetch('JAVA_HOME', '/usr')
186
- @jarsigner_path ||= %x[find -L #{java_home_path} -name jarsigner 2>/dev/null].split("\n").first
187
- end
188
109
  end
189
110
  end
190
111
  end
@@ -5,13 +5,6 @@ describe DPL::Provider::TestFairy do
5
5
 
6
6
  before (:all) do
7
7
 
8
- %x[mkdir /tmp/android/]
9
- %x[echo 'cp $3 $4' > /tmp/android/zipalign]
10
- %x[chmod +x /tmp/android/zipalign]
11
-
12
- @kyestore = '/tmp/debug.keystore'
13
- %x[curl -Lso #{@kyestore} http://www.testfairy.com/support-files/travis/dpl/debug.keystore]
14
-
15
8
  @local_android_app = '/tmp/android.apk'
16
9
  %x[curl -Lso #{@local_android_app} http://www.testfairy.com/support-files/travis/dpl/android.apk]
17
10
 
@@ -26,12 +19,14 @@ describe DPL::Provider::TestFairy do
26
19
 
27
20
  subject :provider do
28
21
  # the account is travis-test@testfairy.com
29
- described_class.new(context, :api_key => '4b85a2c03ba6026f4e22640a0432638180e1d1ea', :storepass => "android", :alias => "androiddebugkey", :keystore_file => @kyestore, :video => "true", :video_quality => 'low')
22
+ described_class.new(context, :api_key => '4b85a2c03ba6026f4e22640a0432638180e1d1ea', :video => "true", :video_quality => 'low')
30
23
  end
31
24
 
25
+
32
26
  describe "#check_auth" do
27
+
33
28
  example "check_auth without app_file" do
34
- lambda {provider.check_auth}.should raise_error
29
+ expect {provider.check_auth}.to raise_error("App file is missing")
35
30
  end
36
31
 
37
32
  example "check_auth with app_file" do
@@ -47,31 +42,15 @@ describe DPL::Provider::TestFairy do
47
42
  end
48
43
 
49
44
  describe "#push_app" do
50
- before do
51
- context.stub(:env) { {'ANDROID_HOME' => '/tmp/android', 'JAVA_HOME' => '/usr/bin'} }
52
- end
53
-
54
45
  example "push_app without app_file" do
55
- lambda {provider.push_app}.should raise_error
46
+ expect {provider.check_auth }.to raise_error("App file is missing")
56
47
  end
57
48
 
58
- xit "push_app with app_file" do
49
+ example "push_app with app_file" do
59
50
  provider.options.update(:app_file => @local_android_app)
60
51
  provider.push_app
61
52
  end
62
53
 
63
- example "push_app with wrong alias" do
64
- provider.options.update(:app_file => @local_android_app)
65
- provider.options.update(:alias => 'test')
66
- lambda {provider.push_app}.should raise_error
67
- end
68
-
69
- example "push_app with wrong storepass" do
70
- provider.options.update(:app_file => @local_android_app)
71
- provider.options.update(:storepass => 'test')
72
- lambda {provider.push_app}.should raise_error
73
- end
74
-
75
54
  example "push_app with iOS app_file" do
76
55
  provider.options.update(:app_file => @local_ios_app)
77
56
  provider.push_app
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.46.travis.2418.5
4
+ version: 1.8.46.travis.2444.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-12 00:00:00.000000000 Z
11
+ date: 2018-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -108,6 +108,7 @@ extensions: []
108
108
  extra_rdoc_files: []
109
109
  files:
110
110
  - ".coveralls.yml"
111
+ - ".github/CONTRIBUTING.md"
111
112
  - ".gitignore"
112
113
  - ".rspec"
113
114
  - ".travis.yml"
@@ -115,7 +116,6 @@ files:
115
116
  - LICENSE
116
117
  - README.md
117
118
  - Rakefile
118
- - TESTING.md
119
119
  - bin/dpl
120
120
  - dpl.gemspec
121
121
  - lib/dpl/cli.rb