iron_worker_ng 0.15.0 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a1d09476d4f49d5635b9997d6c22fb4cddf6bb30
4
+ data.tar.gz: 4997d6fb2b6d27bd4e886f4e10fec0b66d1e081c
5
+ SHA512:
6
+ metadata.gz: f9a6fed61cd17f7317531c4acde1916cc251e415d87ef6cc117cc403f8f69c12533541ade06ce5559f2207c148d02987a6209c758afa1900f9c0d4d55f969f79
7
+ data.tar.gz: 9ab4eb907b77134481c0578a00c68c5dc36ef1822056531ec7af84de2872c1722bee271d90ee5622535d8341faf50b3483e3c1d0c4d4f71790425efc3f1652ee
data/bin/iron_worker CHANGED
@@ -73,6 +73,10 @@ if command == 'upload'
73
73
  options[:retries_delay] = v
74
74
  end
75
75
 
76
+ opts.on('-h', '--host HOST', String, 'host name, eg: www.mydomain.com') do |v|
77
+ options[:host] = v
78
+ end
79
+
76
80
  opts.on('-a', '--async', 'don\'t wait for package build') do |v|
77
81
  params[:async] = true
78
82
  end
@@ -65,6 +65,7 @@ module IronWorkerNG
65
65
  log "Max concurrency set to '#{options[:max_concurrency]}'" unless options[:max_concurrency].nil?
66
66
  log "Retries set to '#{options[:retries]}'" unless options[:retries].nil?
67
67
  log "Retries delay set to '#{options[:retries_delay]}'" unless options[:retries_delay].nil?
68
+ log "Host set to '#{options[:host]}'" unless options[:host].nil?
68
69
 
69
70
  if code.remote_build_command || code.full_remote_build
70
71
  log_group "Uploading and building code package '#{code.name}'"
@@ -1,5 +1,4 @@
1
1
  require 'ostruct'
2
- require 'json'
3
2
  require 'base64'
4
3
 
5
4
  require 'iron_worker_ng/api_client'
@@ -89,6 +88,11 @@ module IronWorkerNG
89
88
  def codes_create(code, options = {})
90
89
  IronCore::Logger.debug 'IronWorkerNG', "Calling codes.create with code='#{code.to_s}' and options='#{options.to_s}'"
91
90
 
91
+ if options[:config] && options[:config].is_a?(Hash)
92
+ options = options.dup
93
+ options[:config] = options[:config].to_json
94
+ end
95
+
92
96
  container_file = code.create_container
93
97
 
94
98
  if code.remote_build_command.nil? && (not code.full_remote_build)
@@ -122,6 +126,11 @@ module IronWorkerNG
122
126
  def codes_create_async(code, options = {})
123
127
  IronCore::Logger.debug 'IronWorkerNG', "Calling codes.create_async with code='#{code.to_s}' and options='#{options.to_s}'"
124
128
 
129
+ if options[:config] && options[:config].is_a?(Hash)
130
+ options = options.dup
131
+ options[:config] = options[:config].to_json
132
+ end
133
+
125
134
  container_file = code.create_container
126
135
 
127
136
  if code.remote_build_command.nil? && (not code.full_remote_build)
@@ -37,7 +37,7 @@ BUILDER_SH
37
37
  install_iron_worker_ng = ''
38
38
 
39
39
  if not @use_local_iron_worker_ng
40
- install_iron_worker_ng = "system(\"gem install iron_worker_ng -v #{IronWorkerNG::VERSION}\")"
40
+ install_iron_worker_ng = "system('gem install iron_worker_ng -v #{IronWorkerNG::VERSION}')"
41
41
  end
42
42
 
43
43
  container.get_output_stream(@dest_dir + '__builder__.rb') do |builder|
@@ -58,6 +58,20 @@ IronWorkerNG::Feature::Ruby::MergeGem.merge_binary = true
58
58
 
59
59
  code = IronWorkerNG::Code::Base.new(params[:code_name])
60
60
 
61
+ if not File.exists?('bundler.magic')
62
+ deps = code.features.reject { |f| f.class != IronWorkerNG::Feature::Ruby::MergeGemDependency::Feature }
63
+
64
+ deps.each do |dep|
65
+ if dep.name == 'bundler' and dep.version != '>= 0'
66
+ system('touch bundler.magic')
67
+ system('gem uninstall bundler')
68
+ system("gem install bundler -v '\#{dep.version}'")
69
+ success = system("ruby __runner__.rb \#{ARGV.join(' ')}")
70
+ exit(success ? 0 : 1)
71
+ end
72
+ end
73
+ end
74
+
61
75
  if File.exists?('__builder__.sh')
62
76
  pre_build_list = Dir.glob('__build__/**/**')
63
77
 
@@ -30,11 +30,13 @@ end
30
30
 
31
31
  root = nil
32
32
  payload_file = nil
33
+ config_file = nil
33
34
  task_id = nil
34
35
 
35
36
  0.upto($*.length - 2) do |i|
36
37
  root = $*[i + 1] if $*[i] == '-d'
37
38
  payload_file = $*[i + 1] if $*[i] == '-payload'
39
+ config_file = $*[i + 1] if $*[i] == '-config'
38
40
  task_id = $*[i + 1] if $*[i] == '-id'
39
41
  end
40
42
 
@@ -55,12 +57,26 @@ begin
55
57
  rescue
56
58
  end
57
59
 
60
+ @config = nil
61
+ if config_file
62
+ @config = File.read(config_file)
63
+ begin
64
+ @config = JSON.parse(@config)
65
+ @config = IronWorkerNGHash.new(@config)
66
+ rescue
67
+ end
68
+ end
69
+
58
70
  @params = IronWorkerNGHash.new(params)
59
71
 
60
72
  def payload
61
73
  @payload
62
74
  end
63
75
 
76
+ def config
77
+ @config
78
+ end
79
+
64
80
  def params
65
81
  @params
66
82
  end
@@ -109,7 +125,7 @@ RUN_CODE
109
125
  gemfile = File.open(gemfile_dir + '/Gemfile', 'w')
110
126
  end
111
127
 
112
- gemfile.puts('source :rubygems')
128
+ gemfile.puts('source \'http://rubygems.org\'')
113
129
 
114
130
  deps = @features.reject { |f| f.class != IronWorkerNG::Feature::Ruby::MergeGemDependency::Feature }
115
131
 
@@ -1,5 +1,5 @@
1
1
  module IronWorkerNG
2
- VERSION = '0.15.0'
2
+ VERSION = '0.15.1'
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -1,3 +1,9 @@
1
+ begin
2
+ require 'json'
3
+ rescue LoadError
4
+ raise "Please install json gem"
5
+ end
6
+
1
7
  require 'iron_worker_ng/version'
2
8
  require 'iron_worker_ng/compat'
3
9
  require 'iron_worker_ng/fetcher'
metadata CHANGED
@@ -1,183 +1,164 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: iron_worker_ng
3
- version: !ruby/object:Gem::Version
4
- hash: 35
5
- prerelease:
6
- segments:
7
- - 0
8
- - 15
9
- - 0
10
- version: 0.15.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.15.1
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Andrew Kirilenko
14
8
  - Iron.io, Inc
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2013-01-18 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2013-03-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: iron_core
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 9
30
- segments:
31
- - 0
32
- - 5
33
- - 1
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
34
20
  version: 0.5.1
35
21
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: bundler
39
22
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 31
46
- segments:
47
- - 1
48
- - 2
49
- - 0
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 0.5.1
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
50
34
  version: 1.2.0
51
35
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: rubyzip
55
36
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 41
62
- segments:
63
- - 0
64
- - 9
65
- - 9
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: 1.2.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: rubyzip
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
66
48
  version: 0.9.9
67
49
  type: :runtime
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: test-unit
71
50
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 3
78
- segments:
79
- - 0
80
- version: "0"
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: 0.9.9
56
+ - !ruby/object:Gem::Dependency
57
+ name: test-unit
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
81
63
  type: :development
82
- version_requirements: *id004
83
- - !ruby/object:Gem::Dependency
84
- name: minitest
85
64
  prerelease: false
86
- requirement: &id005 !ruby/object:Gem::Requirement
87
- none: false
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- hash: 3
92
- segments:
93
- - 0
94
- version: "0"
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: minitest
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
95
77
  type: :development
96
- version_requirements: *id005
97
- - !ruby/object:Gem::Dependency
98
- name: minitest-reporters
99
78
  prerelease: false
100
- requirement: &id006 !ruby/object:Gem::Requirement
101
- none: false
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- hash: 11
106
- segments:
107
- - 0
108
- - 5
109
- - 0
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: minitest-reporters
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
110
90
  version: 0.5.0
111
91
  type: :development
112
- version_requirements: *id006
113
- - !ruby/object:Gem::Dependency
114
- name: rake
115
92
  prerelease: false
116
- requirement: &id007 !ruby/object:Gem::Requirement
117
- none: false
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- hash: 3
122
- segments:
123
- - 0
124
- version: "0"
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: 0.5.0
98
+ - !ruby/object:Gem::Dependency
99
+ name: rake
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - '>='
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
125
105
  type: :development
126
- version_requirements: *id007
127
- - !ruby/object:Gem::Dependency
128
- name: twitter
129
106
  prerelease: false
130
- requirement: &id008 !ruby/object:Gem::Requirement
131
- none: false
132
- requirements:
133
- - - ">="
134
- - !ruby/object:Gem::Version
135
- hash: 3
136
- segments:
137
- - 0
138
- version: "0"
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: twitter
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
139
119
  type: :development
140
- version_requirements: *id008
141
- - !ruby/object:Gem::Dependency
142
- name: actionmailer
143
120
  prerelease: false
144
- requirement: &id009 !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- hash: 3
150
- segments:
151
- - 0
152
- version: "0"
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: actionmailer
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
153
133
  type: :development
154
- version_requirements: *id009
155
- - !ruby/object:Gem::Dependency
156
- name: iron_cache
157
134
  prerelease: false
158
- requirement: &id010 !ruby/object:Gem::Requirement
159
- none: false
160
- requirements:
161
- - - ">="
162
- - !ruby/object:Gem::Version
163
- hash: 7
164
- segments:
165
- - 1
166
- - 4
167
- - 0
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - '>='
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ - !ruby/object:Gem::Dependency
141
+ name: iron_cache
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - '>='
145
+ - !ruby/object:Gem::Version
168
146
  version: 1.4.0
169
147
  type: :development
170
- version_requirements: *id010
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - '>='
152
+ - !ruby/object:Gem::Version
153
+ version: 1.4.0
171
154
  description: New generation ruby client for IronWorker
172
- email:
155
+ email:
173
156
  - info@iron.io
174
- executables:
157
+ executables:
175
158
  - iron_worker
176
159
  extensions: []
177
-
178
160
  extra_rdoc_files: []
179
-
180
- files:
161
+ files:
181
162
  - lib/3rdparty/hashie/indifferent_access.rb
182
163
  - lib/3rdparty/hashie/merge_initializer.rb
183
164
  - lib/iron_worker_ng/fetcher.rb
@@ -226,40 +207,26 @@ files:
226
207
  - bin/iron_worker
227
208
  homepage: https://github.com/iron-io/iron_worker_ruby_ng
228
209
  licenses: []
229
-
210
+ metadata: {}
230
211
  post_install_message:
231
212
  rdoc_options: []
232
-
233
- require_paths:
213
+ require_paths:
234
214
  - lib
235
- required_ruby_version: !ruby/object:Gem::Requirement
236
- none: false
237
- requirements:
238
- - - ">="
239
- - !ruby/object:Gem::Version
240
- hash: 31
241
- segments:
242
- - 1
243
- - 8
244
- version: "1.8"
245
- required_rubygems_version: !ruby/object:Gem::Requirement
246
- none: false
247
- requirements:
248
- - - ">="
249
- - !ruby/object:Gem::Version
250
- hash: 23
251
- segments:
252
- - 1
253
- - 3
254
- - 6
215
+ required_ruby_version: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - '>='
218
+ - !ruby/object:Gem::Version
219
+ version: '1.8'
220
+ required_rubygems_version: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - '>='
223
+ - !ruby/object:Gem::Version
255
224
  version: 1.3.6
256
225
  requirements: []
257
-
258
226
  rubyforge_project:
259
- rubygems_version: 1.8.24
227
+ rubygems_version: 2.0.2
260
228
  signing_key:
261
- specification_version: 3
229
+ specification_version: 4
262
230
  summary: New generation ruby client for IronWorker
263
231
  test_files: []
264
-
265
232
  has_rdoc: