xcodebuilder 0.0.19 → 0.0.20

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: 5d00f503638861f5ae2c3388a735ce9148ead34d
4
- data.tar.gz: 9e2c3f9ebbefd5f8deeb58b6b0759f8ae99a97e4
3
+ metadata.gz: ea77b87e0e2dadafaf2381f6415697abc801a378
4
+ data.tar.gz: b3274f9ea9e69dcc37cf134dd048948b9f426f15
5
5
  SHA512:
6
- metadata.gz: 600405aa31e63323e562c98b4b2ffc97952a16b693b71e7379254e9077bbf4bddc84346f9c9270cf2425c6e4cea3e532c5706d001c784b23178e52915162c49b
7
- data.tar.gz: e15b921f581ce76c9f099d5c85b95ac9071578a8c84ab1942f690c5c9f00fb6d66f1dbd821f0357bfc5a222de0bf1b8e7565c8b5284508774fe50f6a33dab566
6
+ metadata.gz: 930ab62f4ac0868a2f6d02803baac787ea7ec356baecb086b35483fa7c4f6427ce66c2c162d2963f84da5bd1c3f6fb99b72239a362132e2f65bd798a72d5a526
7
+ data.tar.gz: 3cfa4fb601026d2afa0720d1a48d7b788bb4f89bf31fba60e0a20059d26fb25bf9e53d557ef1deef596174098fbff283dc8b79cc2c84ee36ee88e94afb2341ea
@@ -29,11 +29,11 @@ module XcodeBuilder
29
29
  private
30
30
 
31
31
  def self.strategies
32
- {:web => Web, :testflight => TestFlight}
32
+ {:scp => SCP, :testflight => TestFlight, :web => Web}
33
33
  end
34
34
  end
35
35
  end
36
36
 
37
- require File.dirname(__FILE__) + '/deployment_strategies/web'
37
+ require File.dirname(__FILE__) + '/deployment_strategies/scp'
38
38
  require File.dirname(__FILE__) + '/deployment_strategies/testflight'
39
-
39
+ require File.dirname(__FILE__) + '/deployment_strategies/web'
@@ -0,0 +1,104 @@
1
+ module XcodeBuilder
2
+ module DeploymentStrategies
3
+ class SCP < Strategy
4
+ def extended_configuration_for_strategy
5
+ proc do
6
+ def deployment_url
7
+ File.join(deploy_to, ipa_name)
8
+ end
9
+
10
+ def manifest_url
11
+ File.join(deploy_to, "manifest.plist")
12
+ end
13
+
14
+ def remote_installation_path
15
+ File.join(remote_directory)
16
+ end
17
+ end
18
+ end
19
+
20
+ def prepare
21
+ plist = CFPropertyList::List.new(:file => "#{@configuration.built_app_path}/Info.plist")
22
+ plist_data = CFPropertyList.native_types(plist.value)
23
+ File.open("pkg/dist/manifest.plist", "w") do |io|
24
+ io << %{<?xml version="1.0" encoding="UTF-8"?>
25
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
26
+ <plist version="1.0">
27
+ <dict>
28
+ <key>items</key>
29
+ <array>
30
+ <dict>
31
+ <key>assets</key>
32
+ <array>
33
+ <dict>
34
+ <key>kind</key>
35
+ <string>software-package</string>
36
+ <key>url</key>
37
+ <string>#{@configuration.deployment_url}</string>
38
+ </dict>
39
+ </array>
40
+ <key>metadata</key>
41
+ <dict>
42
+ <key>bundle-identifier</key>
43
+ <string>#{plist_data['CFBundleIdentifier']}</string>
44
+ <key>bundle-version</key>
45
+ <string>#{plist_data['CFBundleVersion']}</string>
46
+ <key>kind</key>
47
+ <string>software</string>
48
+ <key>title</key>
49
+ <string>#{plist_data['CFBundleDisplayName']}</string>
50
+ </dict>
51
+ </dict>
52
+ </array>
53
+ </dict>
54
+ </plist>
55
+ }
56
+ end
57
+ File.open("pkg/dist/index.html", "w") do |io|
58
+ io << %{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
59
+ <html xmlns="http://www.w3.org/1999/xhtml">
60
+ <head>
61
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
62
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
63
+ <title>Beta Download</title>
64
+ <style type="text/css">
65
+ body {background:#fff;margin:0;padding:0;font-family:arial,helvetica,sans-serif;text-align:center;padding:10px;color:#333;font-size:16px;}
66
+ #container {width:300px;margin:0 auto;}
67
+ h1 {margin:0;padding:0;font-size:14px;}
68
+ p {font-size:13px;}
69
+ .link {background:#ecf5ff;border-top:1px solid #fff;border:1px solid #dfebf8;margin-top:.5em;padding:.3em;}
70
+ .link a {text-decoration:none;font-size:15px;display:block;color:#069;}
71
+ </style>
72
+ </head>
73
+ <body>
74
+ <div id="container">
75
+ <div class="link"><a href="itms-services://?action=download-manifest&url=#{@configuration.manifest_url}">Tap Here to Install<br />#{@configuration.target} #{plist_data['CFBundleVersion']}<br />On Your Device</a></div>
76
+ <p><strong>Link didn't work?</strong><br />
77
+ Make sure you're visiting this page on your device, not your computer.</p>
78
+ </div>
79
+ </body>
80
+ </html>
81
+ }
82
+ end
83
+ end
84
+
85
+ def deploy
86
+ cmd = []
87
+
88
+ cmd.push "scp"
89
+
90
+ if @configuration.remote_port
91
+ cmd.push "-P #{@configuration.remote_port}"
92
+ end
93
+
94
+ cmd.push "pkg/dist/*"
95
+ cmd.push "#{@configuration.remote_host}:#{@configuration.remote_installation_path}"
96
+
97
+ cmd = cmd.join(" ")
98
+
99
+ puts "* Running `#{cmd}`"
100
+ system(cmd)
101
+ end
102
+ end
103
+ end
104
+ end
@@ -1,103 +1,33 @@
1
+ require 'rest_client'
2
+ require 'json'
3
+ require 'fileutils'
4
+
1
5
  module XcodeBuilder
2
6
  module DeploymentStrategies
3
7
  class Web < Strategy
4
- def extended_configuration_for_strategy
5
- proc do
6
- def deployment_url
7
- File.join(deploy_to, ipa_name)
8
- end
9
-
10
- def manifest_url
11
- File.join(deploy_to, "manifest.plist")
12
- end
13
-
14
- def remote_installation_path
15
- File.join(remote_directory)
16
- end
17
- end
18
- end
19
8
 
20
9
  def prepare
21
- plist = CFPropertyList::List.new(:file => "#{@configuration.built_app_path}/Info.plist")
22
- plist_data = CFPropertyList.native_types(plist.value)
23
- File.open("pkg/dist/manifest.plist", "w") do |io|
24
- io << %{<?xml version="1.0" encoding="UTF-8"?>
25
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
26
- <plist version="1.0">
27
- <dict>
28
- <key>items</key>
29
- <array>
30
- <dict>
31
- <key>assets</key>
32
- <array>
33
- <dict>
34
- <key>kind</key>
35
- <string>software-package</string>
36
- <key>url</key>
37
- <string>#{@configuration.deployment_url}</string>
38
- </dict>
39
- </array>
40
- <key>metadata</key>
41
- <dict>
42
- <key>bundle-identifier</key>
43
- <string>#{plist_data['CFBundleIdentifier']}</string>
44
- <key>bundle-version</key>
45
- <string>#{plist_data['CFBundleVersion']}</string>
46
- <key>kind</key>
47
- <string>software</string>
48
- <key>title</key>
49
- <string>#{plist_data['CFBundleDisplayName']}</string>
50
- </dict>
51
- </dict>
52
- </array>
53
- </dict>
54
- </plist>
55
- }
56
- end
57
- File.open("pkg/dist/index.html", "w") do |io|
58
- io << %{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
59
- <html xmlns="http://www.w3.org/1999/xhtml">
60
- <head>
61
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
62
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
63
- <title>Beta Download</title>
64
- <style type="text/css">
65
- body {background:#fff;margin:0;padding:0;font-family:arial,helvetica,sans-serif;text-align:center;padding:10px;color:#333;font-size:16px;}
66
- #container {width:300px;margin:0 auto;}
67
- h1 {margin:0;padding:0;font-size:14px;}
68
- p {font-size:13px;}
69
- .link {background:#ecf5ff;border-top:1px solid #fff;border:1px solid #dfebf8;margin-top:.5em;padding:.3em;}
70
- .link a {text-decoration:none;font-size:15px;display:block;color:#069;}
71
- </style>
72
- </head>
73
- <body>
74
- <div id="container">
75
- <div class="link"><a href="itms-services://?action=download-manifest&url=#{@configuration.manifest_url}">Tap Here to Install<br />#{@configuration.target} #{plist_data['CFBundleVersion']}<br />On Your Device</a></div>
76
- <p><strong>Link didn't work?</strong><br />
77
- Make sure you're visiting this page on your device, not your computer.</p>
78
- </div>
79
- </body>
80
- </html>
81
- }
82
- end
10
+ puts "Nothing to prepare!" if @configuration.verbose
83
11
  end
84
-
12
+
85
13
  def deploy
86
- cmd = []
87
-
88
- cmd.push "scp"
89
-
90
- if @configuration.remote_port
91
- cmd.push "-P #{@configuration.remote_port}"
14
+ puts "Deploying to the web server : '#{@configuration.server_url}'"
15
+
16
+ payload = {
17
+ :ipa_file => File.new(@configuration.ipa_path, 'rb'),
18
+ }
19
+ statusCode = 0
20
+ begin
21
+ response = RestClient::Request.new(:method => :post, :url => "#{@configuration.server_url}", :user => "#{@configuration.server_user}", :password => "#{@configuration.server_password}", :payload => payload).execute
22
+ statusCode = response.code
23
+ rescue => e
24
+ puts "Web upload failed with exception:\n#{e}Response\n#{e.response}"
25
+ end
26
+ if (statusCode == 200) || (statusCode == 201)
27
+ puts "Web upload completed"
28
+ else
29
+ puts "Web upload failed"
92
30
  end
93
-
94
- cmd.push "pkg/dist/*"
95
- cmd.push "#{@configuration.remote_host}:#{@configuration.remote_installation_path}"
96
-
97
- cmd = cmd.join(" ")
98
-
99
- puts "* Running `#{cmd}`"
100
- system(cmd)
101
31
  end
102
32
  end
103
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodebuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Larivain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-03 00:00:00.000000000 Z
11
+ date: 2014-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: CFPropertyList
@@ -81,6 +81,7 @@ files:
81
81
  - README.md
82
82
  - lib/xcode_builder/build_output_parser.rb
83
83
  - lib/xcode_builder/configuration.rb
84
+ - lib/xcode_builder/deployment_strategies/scp.rb
84
85
  - lib/xcode_builder/deployment_strategies/testflight.rb
85
86
  - lib/xcode_builder/deployment_strategies/web.rb
86
87
  - lib/xcode_builder/deployment_strategies.rb