phase 0.0.13 → 0.0.14

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: 81ed72ffd7d7b6c3b2f4ca73388843b33908baef
4
- data.tar.gz: 05d073ed682a2c9cc7ceda09f2f923d12b4e5131
3
+ metadata.gz: 9590eb70829edd6661e39eb4068ee18a060ec7fa
4
+ data.tar.gz: a57a7125ac33e183892a1106ffa54b246d9dc00e
5
5
  SHA512:
6
- metadata.gz: 6e21306de049538b18407cf257cc6b71bc0a06a3da9567a8d5dbe63d33474f6dac82220876a47dc6a69b66d309560e3ca999e9ba85ef00f97aa36ff09646e1cd
7
- data.tar.gz: 166dd495073166248ffc039c002c4cc0c6abe1afa91275cb8091fc6bc03fb7e01f9a09b06e2ec2c03834bfc177eefdf8bdeace3b2d102d74beb7721a05ec19ee
6
+ metadata.gz: 391d201d50bdf8fc062a267cbfa9420770ae91ae3ce964ec701b3b0413a59465ecbe91465b08b565898c829504bbf54c1c8f7b1728cdf8101d43e3eecc52366b
7
+ data.tar.gz: 8ba069008cb11010e2ff2a08287b47684acb68a7d91be271fdc056e4db365bb05bfd494207f9d18defa6a5d577647c35ce2bb07d5aada630aa559e419976ad3f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.13
1
+ 0.0.14
data/lib/phase/cli/ipa.rb CHANGED
@@ -3,7 +3,9 @@ module Phase
3
3
  class IPA < Command
4
4
 
5
5
  command :ipa do |c|
6
- c.syntax = "phase ipa [version_number] [filename|glob_pattern]..."
6
+ c.syntax = "phase ipa [-e environment] version_number filename|glob_pattern..."
7
+
8
+ c.option "-e", "--environment name", String, "Uploads files for 'production' or 'staging' (default is 'staging')."
7
9
 
8
10
  c.description = <<-EOS.strip_heredoc
9
11
  Generates enterprise distribution .plists for .ipa app bundles and uploads
@@ -11,6 +13,7 @@ module Phase
11
13
  EOS
12
14
 
13
15
  c.action do |args, options|
16
+ options.default environment: "staging"
14
17
  new(args, options).run
15
18
  end
16
19
  end
@@ -22,7 +25,7 @@ module Phase
22
25
  @filenames = args
23
26
 
24
27
  if @version.blank? || @filenames.blank?
25
- fail "invalid syntax: phase ipa [version_number] [filename|glob_pattern]..."
28
+ fail "invalid syntax: phase ipa [-e environment] version_number filename|glob_pattern..."
26
29
  end
27
30
 
28
31
  if Phase.config.ipa.bundle_id_prefix.blank?
@@ -37,7 +40,7 @@ module Phase
37
40
  end
38
41
 
39
42
  def run
40
- deployment = ::Phase::IPA::EnterpriseDeployment.new(version, *filenames)
43
+ deployment = ::Phase::IPA::EnterpriseDeployment.new(options.environment, version, *filenames)
41
44
  deployment.run!
42
45
  end
43
46
 
@@ -3,9 +3,9 @@ module Phase
3
3
  class EnterpriseDeployment
4
4
  include ::Phase::Util::Console
5
5
 
6
- attr_reader :version, :file_paths, :aws, :bucket, :prefix, :apps
6
+ attr_reader :version, :file_paths, :aws, :bucket, :prefix, :manifest_key
7
7
 
8
- def initialize(version, *filenames)
8
+ def initialize(environment, version, *filenames)
9
9
  @version = version
10
10
  @file_paths = filenames.map do |name|
11
11
  ::Dir.glob( ::File.expand_path(name) )
@@ -18,7 +18,12 @@ module Phase
18
18
  @bucket = aws.directories.get(Phase.config.ipa.bucket_name)
19
19
  @prefix = ::Pathname.new(Phase.config.ipa.directory_prefix)
20
20
 
21
- @apps = []
21
+ if environment == "production"
22
+ @manifest_key = "enterprise/manifest.json"
23
+ else
24
+ @manifest_key = "enterprise/manifest-staging.json"
25
+ @prefix = @prefix.join("staging")
26
+ end
22
27
  end
23
28
 
24
29
  def run!
@@ -84,7 +89,7 @@ module Phase
84
89
 
85
90
  def upload_manifest!(manifest_path)
86
91
  manifest = bucket.files.new({
87
- key: "enterprise/manifest.json",
92
+ key: manifest_key,
88
93
  body: ::File.open(manifest_path),
89
94
  acl: "public-read"
90
95
  })
data/lib/phase/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Phase
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
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.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piers Mainwaring