apprepo 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4df104a9102694794cd681b6fcc02166d26e8c1c
4
- data.tar.gz: 47bc5b2d1ff9b4cfa45f47d7eeb861a4e37d2f7b
3
+ metadata.gz: 487be30e91eb76af18b797e54eb5286b7d6236be
4
+ data.tar.gz: 584a6e042028fbd58c9172ddf9b89db5a6ff38e8
5
5
  SHA512:
6
- metadata.gz: 69193ee567b1ca06c2aedcc3aeadfe5308aa14fc3c8cb929a3ad3fc484baa1470eb512ea2d22bbe7e6e17636d07e7f6536eb36a133469290e7c2d731bf53dd63
7
- data.tar.gz: 8d5d2927717947b29245057c67cd73c1348bea3d099b9ee323bf5230d01af307edeb47415f518678258221125861692908e91b85c5a6dc84a473144295690ba3
6
+ metadata.gz: ec9e44989a13e06d955ce703636c7e7585fe30ba748e2ed7fc267427e24de4f5c5525d9b88350420e90dc635dc2818611e36176086ab84ecfe306d630220922d
7
+ data.tar.gz: bceceaf0296e74faa4f65564f0e77aee7284070322768dfd020165dc49ef3b6f540d2bb00656fcba88fc2d9e6ecef5a4577e80b53cf4c4716d58a89935d1fb46
data/README.md CHANGED
@@ -36,10 +36,10 @@ apprepo
36
36
 
37
37
  [![Twitter: @igraczech](https://img.shields.io/badge/contact-%40igraczech-green.svg?style=flat)](https://twitter.com/igraczech)
38
38
  [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/fastlane/blob/master/deliver/LICENSE)
39
+ ![Status](https://img.shields.io/badge/_waiting--for_-_fastlane--plugins--manager_-yellow.svg)
39
40
  [![Gem](https://img.shields.io/gem/v/apprepo.svg?style=flat)](http://rubygems.org/gems/apprepo)
40
41
  [![Build Status](https://img.shields.io/circleci/project/suculent/apprepo.svg?style=flat)](https://circleci.com/gh/suculent/apprepo)
41
42
  [![Coverage Status](https://coveralls.io/repos/github/suculent/apprepo/badge.svg?branch=master)](https://coveralls.io/github/suculent/apprepo?branch=master)
42
- ![Fastlane](https://img.shields.io/badge/_status_-_waiting--for--fastlane--plugins--manager_-yellow.svg)
43
43
 
44
44
  ###### Deliver IPAs, icons & manifest.json to AppRepo (or any other SFTP server) using a single command.
45
45
 
@@ -15,17 +15,18 @@ require_relative 'apprepo/setup'
15
15
  require_relative 'apprepo/uploader'
16
16
  require_relative 'apprepo/version'
17
17
 
18
+ require 'fastlane'
18
19
  require 'fastlane_core'
19
20
 
20
21
  # Root class of the AppRepo SFTP Uploader
21
22
  module AppRepo
22
23
  class << self
23
24
  def initialize
24
- UI.message('[AppRepo] Initializing...')
25
+ UI.message('AppRepo:self Initializing...')
25
26
  end
26
27
 
27
28
  def new
28
- UI.message('[AppRepo] New...')
29
+ UI.message('AppRepo:new')
29
30
  end
30
31
  end
31
32
 
@@ -1,5 +1,14 @@
1
+
2
+ require 'rubygems'
3
+ require 'json'
4
+ require 'net/ssh'
5
+ require 'net/sftp'
6
+
1
7
  require_relative 'uploader'
8
+
9
+ require 'fastlane'
2
10
  require 'fastlane_core'
11
+ require 'fastlane_core/languages'
3
12
 
4
13
  module AppRepo
5
14
  # Should provide metadata for current appcode
@@ -12,14 +21,16 @@ module AppRepo
12
21
 
13
22
  # Fetches remote app version from metadata
14
23
  def fetch_app_version(options)
15
- metadata = AppRepo::Uploader.new(options).download_metadata
16
- FastlaneCore::UI.user_error!('TODO: Parse version out from metadata')
17
- '0.0'
24
+ metadata = AppRepo::Uploader.new(options).download_manifest_only
25
+ FastlaneCore::UI.command_output('TODO: Parse version out from metadata')
26
+ puts JSON.pretty_generate(metadata) unless metadata.nil?
27
+ FastlaneCore::UI.important('TODO: parse out the bundle-version')
28
+ metadata['bundle-version']
18
29
  end
19
30
 
20
31
  # only for testing, should be empty
21
32
  def run
22
- FastlaneCore::UI.message('AppRepo:Analyser.run for test...')
33
+ FastlaneCore::UI.message('Analyser run, will fetch_app_version...')
23
34
  fetch_app_version(options)
24
35
  end
25
36
  end
@@ -46,11 +46,10 @@ module AppRepo
46
46
  loaded = true if options[:repo_description] || options[:ipa]
47
47
 
48
48
  unless loaded
49
- puts '[AppRepo::CommandsGenerator] configuration file not loaded'
49
+ UI.message('[AppRepo::CommandsGenerator] configuration file not loaded')
50
50
  if UI.confirm('No Repofile found. Do you want to setup apprepo?')
51
51
  require 'apprepo/setup'
52
52
  AppRepo::Setup.new.run(options)
53
- puts '[AppRepo::CommandsGenerator] exiting.'
54
53
  return 0
55
54
  end
56
55
  end
@@ -60,26 +59,14 @@ module AppRepo
60
59
  end
61
60
 
62
61
  command :download_manifest do |c|
63
- c.syntax = 'apprepo download manifest'
64
- c.description = 'Downloads existing metadata and stores it locally.
65
- This overwrites the local files.'
66
-
62
+ c.syntax = 'apprepo download_manifest'
63
+ c.description = 'Download metadata only'
67
64
  c.action do |_args, options|
68
65
  config = FastlaneCore::Configuration
69
66
  available_opts = AppRepo::Options.available_options
70
67
  options = config.create(available_opts, options.__hash__)
71
68
  options.load_configuration_file('Repofile')
72
- AppRepo::Runner.new(options) # to login...
73
- cont = FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.'
74
- path = options[:manifest_path] || File.join(cont, 'metadata')
75
- res = ENV['APPREPO_FORCE_OVERWRITE']
76
- msg = 'Do you want to overwrite existing metadata on path '
77
- res ||= UI.confirm(msg + '#{File.expand_path(path)}' + '?')
78
- return 0 if res.nil?
79
- require 'apprepo/setup'
80
- # TODO: Fetch version from IPA or else
81
- v = options[:app_version].latest_version
82
- AppRepo::Setup.new.generate_metadata_files(v, path)
69
+ AppRepo::Runner.new(options).download_manifest
83
70
  end
84
71
  end
85
72
 
@@ -91,8 +78,6 @@ module AppRepo
91
78
  available_opts = AppRepo::Options.available_options
92
79
  options = config.create(available_opts, options.__hash__)
93
80
  options.load_configuration_file('Repofile')
94
- options[:submit_for_review] = true
95
- options[:build_number] = 'latest' unless options[:build_number]
96
81
  AppRepo::Runner.new(options).run
97
82
  end
98
83
  end
@@ -110,7 +95,7 @@ module AppRepo
110
95
  config = FastlaneCore::Configuration
111
96
  available_opts = AppRepo::Options.available_options
112
97
  options = config.create(available_opts, options.__hash__)
113
- AppRepo::Runner.new(options) # to login...
98
+ AppRepo::Runner.new(options)
114
99
  AppRepo::Setup.new.run(options)
115
100
  end
116
101
  end
@@ -8,9 +8,7 @@ module AppRepo
8
8
  def initialize(options)
9
9
  self.options = options
10
10
  AppRepo::DetectValues.new.run!(self.options)
11
- # FastlaneCore::PrintTable.print_values(config: options,
12
- # hide_keys: [:app], mask_keys: [],
13
- # title: "deliver #{AppRepo::VERSION} Summary")
11
+ FastlaneCore::PrintTable.print_values(config: options, hide_keys: [:repo_password], mask_keys: [:repo_key], title: "apprepo-sftp #{AppRepo::VERSION} Summary")
14
12
  end
15
13
 
16
14
  # rubocop:disable Metrics/AbcSize
@@ -18,7 +16,6 @@ module AppRepo
18
16
  def run
19
17
  UI.success('AppRepo SFTP Uploader running...')
20
18
  verify_version unless options[:app_version].to_s.empty?
21
- upload_metadata
22
19
  has_binary = options[:ipa]
23
20
  if !options[:skip_binary_upload] && !options[:build_number] && has_binary
24
21
  upload_binary
@@ -42,9 +39,13 @@ module AppRepo
42
39
  # end
43
40
  end
44
41
 
45
- # Upload all metadata, screenshots, pricing information, etc. to AppRepo
46
- def upload_metadata
47
- #
42
+ def download_manifest
43
+ if options[:manifest_path]
44
+ uploader = AppRepo::Uploader.new(options)
45
+ result = uploader.download_manifest_only
46
+ msg = 'Metadata download failed. Check out the error above.'
47
+ UI.user_error!(msg) unless result
48
+ end
48
49
  end
49
50
 
50
51
  # Upload the binary to AppRepo
@@ -52,14 +53,14 @@ module AppRepo
52
53
  if options[:ipa]
53
54
  uploader = AppRepo::Uploader.new(options)
54
55
  result = uploader.upload
55
- msg = 'Binary upload failed. Check out the error above'
56
+ msg = 'Binary upload failed. Check out the error above.'
56
57
  UI.user_error!(msg) unless result
57
58
  end
58
59
  end
59
60
 
60
61
  def notify
61
62
  # should be in metadata
62
- UI.message('TODO: Missing implementation for AppRepo Push Notifier')
63
+ UI.command_output('TODO: Missing implementation for AppRepo Push Notifier')
63
64
  end
64
65
  end
65
66
  end
@@ -31,7 +31,7 @@ module AppRepo
31
31
  path = File.join(apprepo_path, 'metadata')
32
32
  FileUtils.mkdir_p(path)
33
33
  UI.success("TODO: DOWNLOAD MANIFEST'")
34
- AppRepo::Uploader.download_metadata(options, path)
34
+ AppRepo::Uploader.new(options).download_manifest_only
35
35
  end
36
36
 
37
37
  def run(options)
@@ -4,8 +4,6 @@ require 'rubygems'
4
4
  require 'json'
5
5
  require 'net/ssh'
6
6
  require 'net/sftp'
7
-
8
- require 'fastlane'
9
7
  require 'fastlane_core'
10
8
  require 'fastlane_core/languages'
11
9
 
@@ -56,7 +54,20 @@ module AppRepo
56
54
  # rubocop:disable Metrics/MethodLength
57
55
  def upload
58
56
  # Login & Upload IPA with metadata using RSA key or username/password
59
- rsa_key = load_rsa_key(rsa_keypath)
57
+ FastlaneCore::UI.message('upload...')
58
+
59
+ if host.nil? || user.nil?
60
+ FastlaneCore::UI.user_error('repo_url, repo_user and repo_pasdword or repo_key must be set on upload')
61
+ return false
62
+ end
63
+
64
+ if rsa_keypath
65
+ rsa_key = load_rsa_key(rsa_keypath)
66
+ if rsa_key.nil?
67
+ FastlaneCore::UI.user_error('Failed to load RSA key... ' + options[:rsa_keypath])
68
+ end
69
+ end
70
+
60
71
  success = false
61
72
  if !rsa_key.nil?
62
73
  FastlaneCore::UI.message('Logging in with RSA key...')
@@ -65,10 +76,9 @@ module AppRepo
65
76
  success = ssh_sftp_upload(ssh, ipa_path, manifest_path)
66
77
  end
67
78
  else
68
- FastlaneCore::UI.message('Logging in...')
79
+ FastlaneCore::UI.message('Logging in with username/password...')
69
80
  Net::SSH.start(host, user, password: password) do |ssh|
70
- self.ssh_session = ssh
71
- FastlaneCore::UI.message('Logged in, uploading IPA & Manifest...')
81
+ FastlaneCore::UI.message('Uploading IPA & Manifest...')
72
82
  success = ssh_sftp_upload(ssh, ipa_path, manifest_path)
73
83
  end
74
84
  end
@@ -81,35 +91,37 @@ module AppRepo
81
91
 
82
92
  # rubocop:disable Metrics/AbcSize
83
93
  # rubocop:disable Metrics/MethodLength
84
- def download_metadata
94
+ def download_manifest_only
95
+ FastlaneCore::UI.message('download_manifest_only...')
85
96
  rsa_key = load_rsa_key(rsa_keypath)
86
- if rsa_key?
87
- FastlaneCore::UI.message('Logging in with RSA key...')
97
+ success = true
98
+ if !rsa_key.nil?
99
+ FastlaneCore::UI.message('Logging in with RSA key for download...')
88
100
  Net::SSH.start(host, user, key_data: rsa_key, keys_only: true) do |ssh|
89
- self.ssh_session = ssh
90
101
  FastlaneCore::UI.message('Uploading UPA & Manifest...')
91
- ssh_sftp_download(ssh, manifest_path)
102
+ success = ssh_sftp_download(ssh, manifest_path)
92
103
  end
93
104
  else
94
- FastlaneCore::UI.message('Logging in...')
105
+ FastlaneCore::UI.message('Logging in for download...')
95
106
  Net::SSH.start(host, user, password: password) do |ssh|
96
- self.ssh_session = ssh
97
- FastlaneCore::UI.message('Logged in, uploading UPA & Manifest...')
98
- ssh_sftp_download(ssh, manifest_path)
107
+ FastlaneCore::UI.message('Uploading UPA & Manifest...')
108
+ success = ssh_sftp_download(ssh, manifest_path)
99
109
  end
100
110
  end
111
+ success
101
112
  end
102
113
 
103
114
  private
104
115
 
105
- def ssh_sftp_download(ssh, local_ipa_path, _manifest_path)
116
+ def ssh_sftp_download(ssh, _manifest_path)
106
117
  ssh.sftp.connect do |sftp|
107
- break unless check_ipa(local_ipa_path)
108
- FastlaneCore::UI.message('[Downloading] Will start...')
118
+ FastlaneCore::UI.message('Fetching remote manifest...')
109
119
  manifest = download_manifest(sftp)
110
120
  puts '********************************************************'
111
121
  puts JSON.pretty_generate(manifest)
112
122
  puts '********************************************************'
123
+ FastlaneCore::UI.success('Successfully fetched manifest')
124
+ FastlaneCore::UI.command_output('TODO: Processing manifest not implemented.')
113
125
  end
114
126
  end
115
127
 
@@ -212,7 +224,7 @@ module AppRepo
212
224
  # @param [String] local_ipa_path
213
225
  # @param [String] remote_ipa_path
214
226
  def upload_ipa(sftp, local_ipa_path, remote_ipa_path)
215
- msg = '[Uploading IPA] ' + local_ipa_path + ' to ' + remote_ipa_path
227
+ msg = "[Uploading IPA] #{local_ipa_path} to #{remote_ipa_path}"
216
228
  FastlaneCore::UI.message(msg)
217
229
  result = sftp.upload!(local_ipa_path, remote_ipa_path) do |event, _uploader, *_args|
218
230
  case event
@@ -224,7 +236,7 @@ module AppRepo
224
236
  when :close then
225
237
  puts "\n"
226
238
  when :finish then
227
- FastlaneCore::UI.success('Upload successful!')
239
+ FastlaneCore::UI.success('IPA upload successful')
228
240
  end
229
241
  end
230
242
  end
@@ -240,7 +252,7 @@ module AppRepo
240
252
  result = sftp.upload!(local_path, remote_path) do |event, _uploader, *_args|
241
253
  case event
242
254
  when :finish then
243
- FastlaneCore::UI.success('Upload successful!')
255
+ FastlaneCore::UI.success('Manifest upload successful')
244
256
  end
245
257
  end
246
258
  end
@@ -265,7 +277,7 @@ module AppRepo
265
277
  sftp.mkdir remote_path
266
278
  rescue Net::SFTP::StatusException => e
267
279
  raise if e.code != 11
268
- msg = 'Remote dir ' + remote_path + ' exists.'
280
+ msg = "Remote dir #{remote_path} exists."
269
281
  FastlaneCore::UI.message(msg)
270
282
  end
271
283
 
@@ -1,5 +1,6 @@
1
1
  module AppRepo
2
- VERSION = '0.0.8'.freeze
3
- DESCRIPTION = 'Upload icon, manifest.json and your app to the T-Mobile Enterprise AppRepo and notify users on updaet using a single command'.freeze
4
- SUMMARY = 'Upload icon, manifest and your app to SFTP'.freeze
2
+ VERSION = "0.0.9".freeze
3
+ DESCRIPTION = "Upload icon, manifest.json and your app to SFTP server
4
+ and notify users on updaet using a single command".freeze
5
+ SUMMARY = "Upload icon, manifest and your app to SFTP".freeze
5
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apprepo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -9,22 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-25 00:00:00.000000000 Z
12
+ date: 2016-05-26 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: fastlane
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '0'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: '0'
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: fastlane_core
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -45,28 +31,28 @@ dependencies:
45
31
  requirements:
46
32
  - - "~>"
47
33
  - !ruby/object:Gem::Version
48
- version: '0'
34
+ version: '2.6'
49
35
  type: :runtime
50
36
  prerelease: false
51
37
  version_requirements: !ruby/object:Gem::Requirement
52
38
  requirements:
53
39
  - - "~>"
54
40
  - !ruby/object:Gem::Version
55
- version: '0'
41
+ version: '2.6'
56
42
  - !ruby/object:Gem::Dependency
57
43
  name: net-sftp
58
44
  requirement: !ruby/object:Gem::Requirement
59
45
  requirements:
60
46
  - - "~>"
61
47
  - !ruby/object:Gem::Version
62
- version: '0'
48
+ version: '2.1'
63
49
  type: :runtime
64
50
  prerelease: false
65
51
  version_requirements: !ruby/object:Gem::Requirement
66
52
  requirements:
67
53
  - - "~>"
68
54
  - !ruby/object:Gem::Version
69
- version: '0'
55
+ version: '2.1'
70
56
  - !ruby/object:Gem::Dependency
71
57
  name: json
72
58
  requirement: !ruby/object:Gem::Requirement
@@ -248,21 +234,22 @@ dependencies:
248
234
  - !ruby/object:Gem::Version
249
235
  version: '0'
250
236
  - !ruby/object:Gem::Dependency
251
- name: coverband
237
+ name: fastlane
252
238
  requirement: !ruby/object:Gem::Requirement
253
239
  requirements:
254
240
  - - "~>"
255
241
  - !ruby/object:Gem::Version
256
- version: '0'
242
+ version: '1.89'
257
243
  type: :development
258
244
  prerelease: false
259
245
  version_requirements: !ruby/object:Gem::Requirement
260
246
  requirements:
261
247
  - - "~>"
262
248
  - !ruby/object:Gem::Version
263
- version: '0'
264
- description: Upload icon, manifest.json and your app to the T-Mobile Enterprise AppRepo
265
- and notify users on updaet using a single command
249
+ version: '1.89'
250
+ description: |-
251
+ Upload icon, manifest.json and your app to SFTP server
252
+ and notify users on updaet using a single command
266
253
  email:
267
254
  - suculent@me.com
268
255
  executables: []
@@ -305,7 +292,7 @@ rubyforge_project:
305
292
  rubygems_version: 2.6.1
306
293
  signing_key:
307
294
  specification_version: 4
308
- summary: Upload icon, manifest.json and your app to the T-Mobile Enterprise AppRepo
309
- and notify users on updaet using a single command
295
+ summary: Upload icon, manifest.json and your app to SFTP server and notify users on
296
+ updaet using a single command
310
297
  test_files: []
311
298
  has_rdoc: