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 +4 -4
- data/README.md +1 -1
- data/lib/apprepo.rb +3 -2
- data/lib/apprepo/analyser.rb +15 -4
- data/lib/apprepo/commands_generator.rb +5 -20
- data/lib/apprepo/runner.rb +10 -9
- data/lib/apprepo/setup.rb +1 -1
- data/lib/apprepo/uploader.rb +34 -22
- data/lib/apprepo/version.rb +4 -3
- metadata +14 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 487be30e91eb76af18b797e54eb5286b7d6236be
|
4
|
+
data.tar.gz: 584a6e042028fbd58c9172ddf9b89db5a6ff38e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec9e44989a13e06d955ce703636c7e7585fe30ba748e2ed7fc267427e24de4f5c5525d9b88350420e90dc635dc2818611e36176086ab84ecfe306d630220922d
|
7
|
+
data.tar.gz: bceceaf0296e74faa4f65564f0e77aee7284070322768dfd020165dc49ef3b6f540d2bb00656fcba88fc2d9e6ecef5a4577e80b53cf4c4716d58a89935d1fb46
|
data/README.md
CHANGED
@@ -36,10 +36,10 @@ apprepo
|
|
36
36
|
|
37
37
|
[](https://twitter.com/igraczech)
|
38
38
|
[](https://github.com/fastlane/fastlane/blob/master/deliver/LICENSE)
|
39
|
+

|
39
40
|
[](http://rubygems.org/gems/apprepo)
|
40
41
|
[](https://circleci.com/gh/suculent/apprepo)
|
41
42
|
[](https://coveralls.io/github/suculent/apprepo?branch=master)
|
42
|
-

|
43
43
|
|
44
44
|
###### Deliver IPAs, icons & manifest.json to AppRepo (or any other SFTP server) using a single command.
|
45
45
|
|
data/lib/apprepo.rb
CHANGED
@@ -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('
|
25
|
+
UI.message('AppRepo:self Initializing...')
|
25
26
|
end
|
26
27
|
|
27
28
|
def new
|
28
|
-
UI.message('
|
29
|
+
UI.message('AppRepo:new')
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
data/lib/apprepo/analyser.rb
CHANGED
@@ -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).
|
16
|
-
FastlaneCore::UI.
|
17
|
-
|
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('
|
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
|
-
|
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
|
64
|
-
c.description = '
|
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)
|
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)
|
98
|
+
AppRepo::Runner.new(options)
|
114
99
|
AppRepo::Setup.new.run(options)
|
115
100
|
end
|
116
101
|
end
|
data/lib/apprepo/runner.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
46
|
-
|
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.
|
63
|
+
UI.command_output('TODO: Missing implementation for AppRepo Push Notifier')
|
63
64
|
end
|
64
65
|
end
|
65
66
|
end
|
data/lib/apprepo/setup.rb
CHANGED
@@ -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.
|
34
|
+
AppRepo::Uploader.new(options).download_manifest_only
|
35
35
|
end
|
36
36
|
|
37
37
|
def run(options)
|
data/lib/apprepo/uploader.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
94
|
+
def download_manifest_only
|
95
|
+
FastlaneCore::UI.message('download_manifest_only...')
|
85
96
|
rsa_key = load_rsa_key(rsa_keypath)
|
86
|
-
|
87
|
-
|
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
|
-
|
97
|
-
|
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,
|
116
|
+
def ssh_sftp_download(ssh, _manifest_path)
|
106
117
|
ssh.sftp.connect do |sftp|
|
107
|
-
|
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 =
|
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('
|
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('
|
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 =
|
280
|
+
msg = "Remote dir #{remote_path} exists."
|
269
281
|
FastlaneCore::UI.message(msg)
|
270
282
|
end
|
271
283
|
|
data/lib/apprepo/version.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module AppRepo
|
2
|
-
VERSION =
|
3
|
-
DESCRIPTION =
|
4
|
-
|
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.
|
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-
|
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: '
|
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: '
|
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: '
|
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: '
|
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:
|
237
|
+
name: fastlane
|
252
238
|
requirement: !ruby/object:Gem::Requirement
|
253
239
|
requirements:
|
254
240
|
- - "~>"
|
255
241
|
- !ruby/object:Gem::Version
|
256
|
-
version: '
|
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: '
|
264
|
-
description:
|
265
|
-
|
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
|
309
|
-
|
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:
|