phase 0.0.12 → 0.0.13

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: ff87524fd331aa1846e689747bc4775a3df69f7d
4
- data.tar.gz: ac049168017802c12ae6ed6b62c202b6c683704f
3
+ metadata.gz: 81ed72ffd7d7b6c3b2f4ca73388843b33908baef
4
+ data.tar.gz: 05d073ed682a2c9cc7ceda09f2f923d12b4e5131
5
5
  SHA512:
6
- metadata.gz: 2358fef15cabba6491fae0977b28790efa8b4e1a16d308c8483951d046ec78a4d038da7291fde10c061acf96e1cfec3047f8f76e396b88e5928135afaf26ed8e
7
- data.tar.gz: 12d985acdbd1f5624517270a12314d55c9a3335bc8945965b3b52a6fdfd40c36f89fdc9062b1ede3951cc94807625251496a24d2db0b3616d6464a585474e353
6
+ metadata.gz: 6e21306de049538b18407cf257cc6b71bc0a06a3da9567a8d5dbe63d33474f6dac82220876a47dc6a69b66d309560e3ca999e9ba85ef00f97aa36ff09646e1cd
7
+ data.tar.gz: 166dd495073166248ffc039c002c4cc0c6abe1afa91275cb8091fc6bc03fb7e01f9a09b06e2ec2c03834bfc177eefdf8bdeace3b2d102d74beb7721a05ec19ee
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.12
1
+ 0.0.13
data/lib/phase/cli/ipa.rb CHANGED
@@ -3,7 +3,7 @@ module Phase
3
3
  class IPA < Command
4
4
 
5
5
  command :ipa do |c|
6
- c.syntax = "phase ipa [version_number] [filename|pattern]..."
6
+ c.syntax = "phase ipa [version_number] [filename|glob_pattern]..."
7
7
 
8
8
  c.description = <<-EOS.strip_heredoc
9
9
  Generates enterprise distribution .plists for .ipa app bundles and uploads
@@ -22,7 +22,7 @@ module Phase
22
22
  @filenames = args
23
23
 
24
24
  if @version.blank? || @filenames.blank?
25
- fail "invalid syntax: phase ipa [--version version_number] [filename|glob_pattern]..."
25
+ fail "invalid syntax: phase ipa [version_number] [filename|glob_pattern]..."
26
26
  end
27
27
 
28
28
  if Phase.config.ipa.bundle_id_prefix.blank?
@@ -24,29 +24,37 @@ module Phase
24
24
  def run!
25
25
  ::FileUtils.mkdir(version) rescue nil
26
26
 
27
- manifest_path = ::File.join(::Dir.pwd, version, "manifest.txt")
28
- ::File.open(manifest_path, 'w') do |manifest|
29
- file_paths.map do |path|
30
- app = App.new(path, version)
31
- app.download_url = download_url(app)
27
+ manifest_hash = file_paths.reduce({}) do |hash, path|
28
+ app = App.new(path, version)
29
+ app.download_url = download_url(app)
32
30
 
33
- log "#{app.name}: writing .plist..."
34
- write_plist!(app)
31
+ log "#{app.name}: writing .plist..."
32
+ write_plist!(app)
35
33
 
36
- log "#{app.name}: copying .ipa..."
37
- copy_ipa!(app)
34
+ log "#{app.name}: copying .ipa..."
35
+ copy_ipa!(app)
38
36
 
39
- log "#{app.name}: uploading files..."
40
- upload!(app)
37
+ log "#{app.name}: uploading files..."
38
+ upload_app!(app)
41
39
 
42
- log "#{app.name}: updating manifest..."
43
- manifest << manifest_url(app)
44
- manifest << "\n"
40
+ log "#{app.name}: building app manifest..."
41
+ hash[app.name] = {
42
+ latest_version: app.version,
43
+ download_url: manifest_url(app)
44
+ }
45
45
 
46
- log "#{app.name}: done"
47
- log ""
48
- end
46
+ log "#{app.name}: done"
47
+ log ""
48
+
49
+ hash
49
50
  end
51
+
52
+ manifest_path = ::File.join(::Dir.pwd, version, "manifest.json")
53
+ ::File.write(manifest_path, manifest_hash.to_json)
54
+
55
+ log "uploading release manifest..."
56
+ upload_manifest!(manifest_path)
57
+ log "done"
50
58
  end
51
59
 
52
60
  def write_plist!(app)
@@ -57,7 +65,7 @@ module Phase
57
65
  ::FileUtils.cp(app.qualified_path, ipa_path(app))
58
66
  end
59
67
 
60
- def upload!(app)
68
+ def upload_app!(app)
61
69
  ipa = bucket.files.new({
62
70
  key: prefix.join(app.ipa_filename),
63
71
  body: ::File.open(ipa_path(app)),
@@ -74,6 +82,16 @@ module Phase
74
82
  plist.save
75
83
  end
76
84
 
85
+ def upload_manifest!(manifest_path)
86
+ manifest = bucket.files.new({
87
+ key: "enterprise/manifest.json",
88
+ body: ::File.open(manifest_path),
89
+ acl: "public-read"
90
+ })
91
+
92
+ manifest.save
93
+ end
94
+
77
95
  private
78
96
 
79
97
  def download_url(app)
data/lib/phase/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Phase
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piers Mainwaring
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-30 00:00:00.000000000 Z
12
+ date: 2015-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: commander