slowlane 0.0.1.alpha → 0.0.3.alpha

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: 4da5cf0bb5f1067cab8ebc8ef1bb464409da21f2
4
- data.tar.gz: bbd56b8f4170cba7a4ae99b091a77b411b17b6e7
3
+ metadata.gz: cd0cad4c9d3f6bb4ee6ea53539b87d3e24251448
4
+ data.tar.gz: 4456fc06d90ce7b0e23985845348ebb05c51dfba
5
5
  SHA512:
6
- metadata.gz: e3b6ecdfa0c0a8b8ad0c8e8ef6989fa57af9caf53e526791abbc8149a538134f9b5b755596dc3d639387bbe1489ed89ac62954972a1843a7a68b60f7c0f60994
7
- data.tar.gz: 2cbfd8dff057a46dadc63c40cf9b34f39fc3da39179ac3a42af23631ccee341c2f6a22a61c75a9a5d36402af953deaeb433a7abcfcdea1690951a15d7ce24b3a
6
+ metadata.gz: d514c40fdff6b274edffd32b2b007c6bcb6d7c0fa573affdf23d2633e70e00b5b0e92f9900eaa466e097d6e91d6750fb3033c220a198119702a7a20a48a5ce16
7
+ data.tar.gz: 0a7f32675c51207489ef494c8ec0237dc382be3df4cd40242632cb766785542477702994a271d49f8b3e9f4c08291506bb324d24189268c6fb58173bad167a33
data/.gitignore CHANGED
@@ -2,3 +2,5 @@ trial/
2
2
  *.env
3
3
  .ruby-*
4
4
  Gemfile.lock
5
+ pkg/*
6
+ *.itmsp
data/bin/slowlane-itunes CHANGED
@@ -4,6 +4,7 @@ require 'rubygems'
4
4
  require "thor"
5
5
  require_relative '../lib/slowlane/itunes/app.rb'
6
6
  require_relative '../lib/slowlane/itunes/team.rb'
7
+ require_relative '../lib/slowlane/itunes/build.rb'
7
8
 
8
9
  class SlowlaneItunes < Thor
9
10
 
@@ -17,6 +18,10 @@ class SlowlaneItunes < Thor
17
18
  desc "team SUBCOMMAND ...ARGS", "manage teams"
18
19
  subcommand "team", Slowlane::Itunes::Team
19
20
 
21
+ desc "build SUBCOMMAND ...ARGS", "manage builds"
22
+ subcommand "build", Slowlane::Itunes::Build
23
+
24
+
20
25
  end
21
26
 
22
27
  SlowlaneItunes.start(ARGV)
data/bin/slowlane-portal CHANGED
@@ -6,6 +6,8 @@ require_relative '../lib/slowlane/portal/team.rb'
6
6
  require_relative '../lib/slowlane/portal/app.rb'
7
7
  require_relative '../lib/slowlane/portal/profile.rb'
8
8
  require_relative '../lib/slowlane/portal/device.rb'
9
+ require_relative '../lib/slowlane/portal/psn.rb'
10
+ require_relative '../lib/slowlane/portal/certificate.rb'
9
11
 
10
12
  class SlowlanePortal < Thor
11
13
 
@@ -27,6 +29,12 @@ class SlowlanePortal < Thor
27
29
 
28
30
  desc "team SUBCOMMAND ...ARGS", "manage teams"
29
31
  subcommand "team", Slowlane::Portal::Team
32
+
33
+ desc "psn SUBCOMMAND ...ARGS", "manage teams"
34
+ subcommand "psn", Slowlane::Portal::Psn
35
+
36
+ desc "certificate SUBCOMMAND ...ARGS", "manage teams"
37
+ subcommand "certificate", Slowlane::Portal::Certificate
30
38
  end
31
39
 
32
40
  SlowlanePortal.start(ARGV)
@@ -0,0 +1,99 @@
1
+ require_relative './util.rb'
2
+ require "spaceship"
3
+
4
+ module Slowlane
5
+ module Itunes
6
+ class Build < Thor
7
+
8
+ class_option :team , :default => '<team>' , :required => true
9
+
10
+ desc "list", "List builds for a particular app <id>"
11
+ option :type , :required => true
12
+ def list(id)
13
+
14
+ c=Utils.credentials(options)
15
+ Spaceship::Tunes.login(c.username,c.password)
16
+
17
+ t=Utils.team(options)
18
+ Spaceship::Tunes.client.team_id=t
19
+
20
+ app = Spaceship::Tunes::Application.find(id)
21
+ require 'pp'
22
+ if (options[:type] == 'live')
23
+ pp app.live_version
24
+ end
25
+
26
+ if (options[:type] == 'edit')
27
+ pp app.edit_version
28
+ pp app.edit_version.candidate_builds unless app.edit_version.nil?
29
+ end
30
+
31
+ end
32
+
33
+
34
+ desc "trains", "List trains for a particular app <id>"
35
+ option :type , :required => true
36
+ def trains(bundle_id)
37
+
38
+ c=Utils.credentials(options)
39
+ Spaceship::Tunes.login(c.username,c.password)
40
+
41
+ t=Utils.team(options)
42
+ Spaceship::Tunes.client.team_id=t
43
+
44
+ app = Spaceship::Tunes::Application.find(bundle_id)
45
+ require 'pp'
46
+ pp app.build_trains
47
+
48
+ end
49
+
50
+ desc "trainnumbers", "List trainnumbers for a particular app <id>,train <train>"
51
+ option :type , :required => true
52
+ def trainnumbers(id,train_id)
53
+
54
+ c=Utils.credentials(options)
55
+ Spaceship::Tunes.login(c.username,c.password)
56
+
57
+ t=Utils.team(options)
58
+ Spaceship::Tunes.client.team_id=t
59
+
60
+ app = Spaceship::Tunes::Application.find(id)
61
+ builds = app.all_builds_for_train(train: train_id)
62
+ builds.each do |build|
63
+ puts "#{build.train_version}|#{build.build_version}|#{build.app_name}|#{build.platform}|#{build.upload_date}|#{build.processing}|#{build.valid}"
64
+ end
65
+
66
+ end
67
+
68
+ desc 'upload', 'upload ipa <bundle_id> <filename>'
69
+ option :temp_dir, :default => '/tmp'
70
+ def upload(bundle_id,filename)
71
+
72
+ c=Utils.credentials(options)
73
+ Spaceship::Tunes.login(c.username,c.password)
74
+
75
+ t=Utils.team(options)
76
+ Spaceship::Tunes.client.team_id=t
77
+
78
+ app = Spaceship::Tunes::Application.find(bundle_id)
79
+
80
+ require "fastlane_core"
81
+ #plist = FastlaneCore::IpaFileAnalyser.fetch_info_plist_file("build.ipa"]) || {}
82
+ #platform = plist["DTPlatformName"]
83
+ #platform = "ios" if platform == "iphoneos" # via https://github.com/fastlane/spaceship/issues/247
84
+ package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate(app_id: app.apple_id,
85
+ ipa_path: filename,
86
+ package_path: options[:temp_dir],
87
+ platform: 'ios')
88
+
89
+ # https://github.com/fastlane/fastlane/blob/1229fc55f004975e94226961ef23bbaa554f82b0/fastlane_core/lib/fastlane_core/itunes_transporter.rb#L267
90
+ puts package_path
91
+ #transporter = FastlaneCore::ItunesTransporter.new(options[:username],options[:password])
92
+ #result = transporter.upload(app.apple_id, package_path)
93
+ end
94
+
95
+
96
+ end
97
+
98
+ end
99
+ end
@@ -1,5 +1,6 @@
1
1
  require 'spaceship'
2
2
  require_relative './util.rb'
3
+ require 'terminal-table'
3
4
 
4
5
  module Slowlane
5
6
  module Itunes
@@ -12,12 +13,22 @@ module Slowlane
12
13
  c=Utils.credentials(options)
13
14
  Spaceship::Tunes.login(c.username,c.password)
14
15
 
16
+ headings = ['vendorId', 'name', 'type', 'roles', 'lastlogin']
17
+ rows = []
15
18
  Spaceship::Tunes.client.teams.each do |team|
16
- require 'pp'
17
- pp team
18
- #puts "#{team['teamId']}|#{team['type']}|#{team['name']}"
19
+ provider = team['contentProvider']
20
+ row = []
21
+ row << provider['contentProviderId']
22
+ row << provider['name']
23
+ row << provider['contentProviderTypes'].join(',')
24
+ row << team['roles'].join(',')
25
+ row << Time.at(team['lastLogin']/1000) .to_datetime
26
+ rows << row
19
27
  end
20
28
 
29
+ table = Terminal::Table.new :headings => headings, :rows => rows
30
+ puts table
31
+
21
32
  end
22
33
 
23
34
  end
@@ -31,8 +31,8 @@ class Utils
31
31
 
32
32
  def self.team(options)
33
33
 
34
- if ENV['SLOWLANE_TEAM']
35
- team=ENV['SLOWLANE_TEAM']
34
+ if ENV['SLOWLANE_ITUNES_TEAM']
35
+ team=ENV['SLOWLANE_ITUNES_TEAM']
36
36
  else
37
37
  if options[:team] == '<team>'
38
38
  puts "team is required"
@@ -1,4 +1,5 @@
1
1
  require_relative './util.rb'
2
+ require 'terminal-table'
2
3
  require "spaceship"
3
4
 
4
5
  module Slowlane
@@ -15,18 +16,22 @@ module Slowlane
15
16
  t=Utils.team(options)
16
17
  Spaceship::Portal.client.team_id=t
17
18
 
19
+ headings = ['appId', 'platform', 'prefix', 'wildcard', 'bundle_id', 'name']
20
+ rows = []
18
21
  Spaceship::Portal.app.all.find_all do |app|
19
- require 'pp'
20
- detail=[]
21
- detail << app.app_id
22
- detail << app.platform
23
- detail << app.prefix
24
- detail << app.is_wildcard
25
- detail << app.bundle_id
26
- detail << app.name
27
- puts detail.join("|")
22
+ row=[]
23
+ row << app.app_id
24
+ row << app.platform
25
+ row << app.prefix
26
+ row << app.is_wildcard
27
+ row << app.bundle_id
28
+ row << app.name
29
+ rows << row
28
30
  end
29
31
 
32
+ table = Terminal::Table.new :headings => headings, :rows => rows
33
+ puts table
34
+
30
35
 
31
36
  end
32
37
 
@@ -0,0 +1,49 @@
1
+ require_relative './util.rb'
2
+ require "spaceship"
3
+ require 'terminal-table'
4
+
5
+
6
+ module Slowlane
7
+ module Portal
8
+ class Certificate < Thor
9
+
10
+ desc "list", "List certificates"
11
+ def list()
12
+
13
+ c=Utils.credentials(options)
14
+ Spaceship::Portal.login(c.username,c.password)
15
+
16
+ t=Utils.team(options)
17
+ Spaceship::Portal.client.team_id=t
18
+
19
+ rows = []
20
+ headings=%w(name status created expires owner_type owner_name owner_id type_display_id can_download type)
21
+ Spaceship::Portal.certificate.all.find_all do |psn|
22
+ row = []
23
+ row << psn.name
24
+ row << psn.status
25
+ row << psn.created
26
+ row << psn.expires
27
+ row << psn.owner_type
28
+ row << psn.owner_name
29
+ row << psn.owner_id
30
+ row << psn.type_display_id
31
+ row << psn.can_download
32
+ # TODO add this type to spaceship
33
+ type = psn.class.name.gsub(/Spaceship::Portal::Certificate/,'').gsub(/::/,'')
34
+ if psn.type_display_id == '3BQKVH9I2X'
35
+ type = 'OldPush'
36
+ end
37
+ row << type
38
+ rows << row
39
+ end
40
+
41
+ table = Terminal::Table.new :headings => headings, :rows => rows
42
+ puts table
43
+
44
+ end
45
+
46
+ end
47
+
48
+ end
49
+ end
@@ -1,5 +1,6 @@
1
1
  require_relative './util.rb'
2
2
  require "spaceship"
3
+ require 'terminal-table'
3
4
 
4
5
  module Slowlane
5
6
  module Portal
@@ -14,10 +15,23 @@ module Slowlane
14
15
  t=Utils.team(options)
15
16
  Spaceship::Portal.client.team_id=t
16
17
 
18
+ headings = [ 'id', 'udid', 'description' ,'status', 'platform', 'model', 'device_type']
19
+ rows = []
17
20
  Spaceship::Portal.device.all.find_all do |device|
18
- puts "#{device.id}|#{device.udid}|#{device.name}"
21
+ row = []
22
+ row << device.id
23
+ row << device.udid
24
+ row << device.name
25
+ row << device.status
26
+ row << device.platform
27
+ row << device.model
28
+ row << device.device_type
29
+ rows << row
19
30
  end
20
31
 
32
+ table = Terminal::Table.new :headings => headings, :rows => rows
33
+ puts table
34
+
21
35
  end
22
36
 
23
37
  desc "add", "Add a device <udid> <description>"
@@ -1,5 +1,6 @@
1
1
  require_relative './util.rb'
2
2
  require "spaceship"
3
+ require 'terminal-table'
3
4
 
4
5
 
5
6
  module Slowlane
@@ -21,16 +22,27 @@ module Slowlane
21
22
  t=Utils.team(options)
22
23
  Spaceship::Portal.client.team_id=t
23
24
 
25
+ rows = []
26
+ headings = [ 'uuid', 'id', 'distribution_method', 'name' ]
24
27
  Spaceship::Portal.provisioning_profile.all.find_all do |profile|
28
+ row = []
29
+ row << profile.uuid
30
+ row << profile.id
31
+ row << profile.distribution_method
32
+ row << profile.name
25
33
  unless options[:filter].nil?
26
34
  if profile.name =~ /#{options[:filter]}/
27
- puts "#{profile.uuid}|#{profile.id}|#{profile.distribution_method}|#{profile.name}"
35
+ rows << row
28
36
  end
29
37
  else
30
- puts "#{profile.uuid}|#{profile.id}|#{profile.distribution_method}|#{profile.name}"
38
+ rows << row
31
39
  end
32
40
 
33
41
  end
42
+
43
+ table = Terminal::Table.new :headings => headings, :rows => rows
44
+ puts table
45
+
34
46
  end
35
47
  end
36
48
  end
@@ -0,0 +1,62 @@
1
+ require_relative './util.rb'
2
+ require "spaceship"
3
+ require 'terminal-table'
4
+
5
+
6
+ module Slowlane
7
+ module Portal
8
+ class Psn < Thor
9
+
10
+ desc "list", "List push notifications"
11
+ def list()
12
+
13
+ c=Utils.credentials(options)
14
+ Spaceship::Portal.login(c.username,c.password)
15
+
16
+ t=Utils.team(options)
17
+ Spaceship::Portal.client.team_id=t
18
+
19
+ rows = []
20
+ headings=%w(name status created expires owner_type owner_name owner_id type_display_id can_download type)
21
+ Spaceship::Portal.certificate.all.find_all do |psn|
22
+ row = []
23
+ row << psn.name
24
+ row << psn.status
25
+ row << psn.created
26
+ row << psn.expires
27
+ row << psn.owner_type
28
+ row << psn.owner_name
29
+ row << psn.owner_id
30
+ row << psn.type_display_id
31
+ row << psn.can_download
32
+ rows << row unless !psn.is_push?
33
+ if psn.kind_of? Spaceship::Portal::Certificate::ProductionPush
34
+ row << 'production'
35
+ else
36
+ row << 'development'
37
+ end
38
+ end
39
+
40
+ table = Terminal::Table.new :headings => headings, :rows => rows
41
+ puts table
42
+
43
+ end
44
+
45
+ desc "create", "create push keypairs"
46
+ def create()
47
+
48
+ keypair=Spaceship::Portal.certificate.create_certificate_signing_request()
49
+ require 'pp'
50
+ puts keypair[0].to_text()
51
+ #puts keypair[0].to_der()
52
+ puts keypair[0].to_pem()
53
+ puts keypair[1].to_text()
54
+
55
+ #csr, pkey = Spaceship::Portal::Certificate.create_certificate_signing_request
56
+ #certificate = Spaceship::Portal::Certificate::ProductionPush.create!(csr: csr, bundle_id: 'net.sunapps.151')
57
+ end
58
+
59
+ end
60
+
61
+ end
62
+ end
@@ -31,8 +31,8 @@ class Utils
31
31
 
32
32
  def self.team(options)
33
33
 
34
- if ENV['SLOWLANE_TEAM']
35
- team=ENV['SLOWLANE_TEAM']
34
+ if ENV['SLOWLANE_PORTAL_TEAM']
35
+ team=ENV['SLOWLANE_PORTAL_TEAM']
36
36
  else
37
37
  if options[:team] == '<team>'
38
38
  puts "team is required"
data/slowlane.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "slowlane"
5
- s.version = "0.0.1.alpha"
5
+ s.version = "0.0.3.alpha"
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.license = 'MIT'
8
8
  s.authors = ["Patrick Debois"]
@@ -16,6 +16,8 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_dependency "thor"
18
18
  s.add_dependency "spaceship"
19
+ s.add_dependency "fastlane_core"
20
+ s.add_dependency "terminal-table"
19
21
 
20
22
  s.files = `git ls-files`.split("\n")
21
23
  s.executables = `git ls-files`.split("\n").map { |f| f =~ /^bin\/(.*)/ ? $1 : nil }.compact
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slowlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha
4
+ version: 0.0.3.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Debois
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -38,6 +38,34 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: fastlane_core
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: terminal-table
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  description: Cli version without supprises
42
70
  email:
43
71
  - patrick.debois@jedi.be
@@ -54,11 +82,14 @@ files:
54
82
  - bin/slowlane-itunes
55
83
  - bin/slowlane-portal
56
84
  - lib/slowlane/itunes/app.rb
85
+ - lib/slowlane/itunes/build.rb
57
86
  - lib/slowlane/itunes/team.rb
58
87
  - lib/slowlane/itunes/util.rb
59
88
  - lib/slowlane/portal/app.rb
89
+ - lib/slowlane/portal/certificate.rb
60
90
  - lib/slowlane/portal/device.rb
61
91
  - lib/slowlane/portal/profile.rb
92
+ - lib/slowlane/portal/psn.rb
62
93
  - lib/slowlane/portal/team.rb
63
94
  - lib/slowlane/portal/util.rb
64
95
  - slowlane.gemspec