vanagon 0.11.1 → 0.11.2

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: 05ba6ccedb21955cc83f9a9b4c879952f97ae2c7
4
- data.tar.gz: c6220fff6a4a1c7ba457447686610988cc778e77
3
+ metadata.gz: 0a8deb8d9d92862103087ff392bce7075f1b999a
4
+ data.tar.gz: b3d3744bd040bb78471170ad446ab70a918038d9
5
5
  SHA512:
6
- metadata.gz: 73104a5003d115067156eba3a0dbebd8b089917392773a7b4e3f3bafc3904fc9befff092c80d509d04a9f1e9ac81911afc1369bea440330b015a2f6828feac00
7
- data.tar.gz: d1c60858b7d44b348fd13bdbbd4454b7c4b6c3e5549384d6011d285f7f0ee099a36135bddc03938d1eded39b271091750b83280ddb4bf4937c4f15d41faeef44
6
+ metadata.gz: e19349ee79f2bf7c48f35adbd7a18d7544d5b7cd60dffb62edfe93a02d21cb9583f903eb688dd0ab1a9c60362d107b70a0ba43407c4ebf2e7ebe972ce9244aaa
7
+ data.tar.gz: 84253136c2c03f6253975532f61cb14a09f43aaa9ed27eeb641d9fc53d1e4aec53c4e688fe700b32e4edef4e263c907b3a332b4e88df62f9acb125f506a95421
data/bin/build CHANGED
@@ -2,7 +2,7 @@
2
2
  load File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "vanagon.rb"))
3
3
 
4
4
  optparse = Vanagon::OptParse.new("#{File.basename(__FILE__)} <project-name> <platform-name> [<target>] [options]",
5
- %i(workdir configdir engine preserve verbose skipcheck only_build remote-workdir))
5
+ %i[workdir configdir engine preserve verbose skipcheck only_build remote-workdir])
6
6
  options = optparse.parse! ARGV
7
7
 
8
8
  project = ARGV[0]
@@ -3,7 +3,7 @@ require 'json'
3
3
 
4
4
  load File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "vanagon.rb"))
5
5
 
6
- optparse = Vanagon::OptParse.new("#{File.basename(__FILE__)} <project-name> <platform-name> [options]", %i(workdir configdir engine))
6
+ optparse = Vanagon::OptParse.new("#{File.basename(__FILE__)} <project-name> <platform-name> [options]", %i[workdir configdir engine])
7
7
  options = optparse.parse! ARGV
8
8
 
9
9
  project = ARGV[0]
data/bin/devkit CHANGED
@@ -2,7 +2,7 @@
2
2
  load File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "vanagon.rb"))
3
3
 
4
4
  optparse = Vanagon::OptParse.new("#{File.basename(__FILE__)} <project-name> <platform-name> [<component-name>...] [options]",
5
- %i(workdir configdir target engine))
5
+ %i[workdir configdir target engine])
6
6
  options = optparse.parse! ARGV
7
7
 
8
8
  project = ARGV[0]
@@ -6,7 +6,7 @@ require 'vanagon/extensions/hashable'
6
6
 
7
7
  load File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "vanagon.rb"))
8
8
 
9
- optparse = Vanagon::OptParse.new("#{File.basename(__FILE__)} <project-name> <platform-name> [options]", %i(workdir configdir engine))
9
+ optparse = Vanagon::OptParse.new("#{File.basename(__FILE__)} <project-name> <platform-name> [options]", %i[workdir configdir engine])
10
10
  options = optparse.parse! ARGV
11
11
 
12
12
  project = ARGV[0]
data/bin/render CHANGED
@@ -3,7 +3,7 @@ load File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "vanagon.rb
3
3
 
4
4
  optparse = Vanagon::OptParse.new(
5
5
  "#{File.basename(__FILE__)} <project-name> <platform-name> [options]",
6
- %i(workdir configdir engine)
6
+ %i[workdir configdir engine]
7
7
  )
8
8
  options = optparse.parse! ARGV
9
9
 
@@ -165,7 +165,8 @@ class Vanagon
165
165
  # @param default_file [String] path to the default file relative to the source
166
166
  # @param service_name [String] name of the service
167
167
  # @param service_type [String] type of the service (network, application, system, etc)
168
- def install_service(service_file, default_file = nil, service_name = @component.name, service_type: nil) # rubocop:disable Metrics/AbcSize
168
+ # @param link_target [String] executable service file should be linked to
169
+ def install_service(service_file, default_file = nil, service_name = @component.name, service_type: nil, link_target: nil) # rubocop:disable Metrics/AbcSize
169
170
  case @component.platform.servicetype
170
171
  when "sysv"
171
172
  target_service_file = File.join(@component.platform.servicedir, service_name)
@@ -203,7 +204,12 @@ class Vanagon
203
204
  end
204
205
 
205
206
  # Install the service and default files
206
- install_file(service_file, target_service_file, mode: target_mode)
207
+ if link_target
208
+ install_file(service_file, link_target, mode: target_mode)
209
+ link link_target, target_service_file
210
+ else
211
+ install_file(service_file, target_service_file, mode: target_mode)
212
+ end
207
213
 
208
214
  if default_file
209
215
  install_file(default_file, target_default_file, mode: default_mode)
@@ -188,7 +188,7 @@ class Vanagon
188
188
  "#{platform[:make]} clean"
189
189
  )
190
190
 
191
- %w(configure build install).each do |type|
191
+ %w[configure build install].each do |type|
192
192
  touchfile = "#{component.name}-#{type}"
193
193
  r.recipe << andand(
194
194
  "[ -e #{touchfile} ]",
@@ -6,7 +6,7 @@ require 'vanagon/component/source/local'
6
6
  class Vanagon
7
7
  class Component
8
8
  class Source
9
- SUPPORTED_PROTOCOLS = %w(file http https git).freeze
9
+ SUPPORTED_PROTOCOLS = %w[file http https git].freeze
10
10
  @rewrite_rules = {}
11
11
 
12
12
  class << self
@@ -13,7 +13,7 @@ class Vanagon
13
13
  attr_accessor :sum, :sum_type
14
14
 
15
15
  # Allowed checksum algorithms to use when validating files
16
- CHECKSUM_TYPES = %w(md5 sha1 sha256 sha512).freeze
16
+ CHECKSUM_TYPES = %w[md5 sha1 sha256 sha512].freeze
17
17
 
18
18
  class << self
19
19
  def valid_url?(target_url) # rubocop:disable Metrics/AbcSize
@@ -8,17 +8,17 @@ class Vanagon
8
8
 
9
9
  # Extensions for files we intend to unpack during the build
10
10
  ARCHIVE_EXTENSIONS = {
11
- "7z" => %w(.7z),
12
- "bzip2" => %w(.bz2 .bz),
13
- "cpio" => %w(.cpio),
14
- "gzip" => %w(.gz .z),
15
- "rar" => %w(.rar),
16
- "tar" => %w(.tar),
17
- "tbz2" => %w(.tar.bz2 .tbz2 .tbz),
18
- "tgz" => %w(.tar.gz .tgz),
19
- "txz" => %w(.tar.xz .txz),
20
- "xz" => %w(.xz),
21
- "zip" => %w(.zip),
11
+ "7z" => %w[.7z],
12
+ "bzip2" => %w[.bz2 .bz],
13
+ "cpio" => %w[.cpio],
14
+ "gzip" => %w[.gz .z],
15
+ "rar" => %w[.rar],
16
+ "tar" => %w[.tar],
17
+ "tbz2" => %w[.tar.bz2 .tbz2 .tbz],
18
+ "tgz" => %w[.tar.gz .tgz],
19
+ "txz" => %w[.tar.xz .txz],
20
+ "xz" => %w[.xz],
21
+ "zip" => %w[.zip],
22
22
  }.freeze
23
23
 
24
24
  class << self
@@ -533,6 +533,27 @@ end" }
533
533
  # The component should now have a service registered
534
534
  expect(comp._component.service.name).to eq('service-test')
535
535
  end
536
+
537
+ it 'installs the file as a link when link_target is specified' do
538
+ comp = Vanagon::Component::DSL.new('service-test', {}, dummy_platform_sysv)
539
+ comp.install_service('component-client.init', 'component-client.sysconfig', link_target: '/tmp/service-test')
540
+ # Look for servicedir creation and copy
541
+ expect(comp._component.install).to include("install -d '/etc/init.d'")
542
+ expect(comp._component.install).to include("cp -p 'component-client.init' '/tmp/service-test'")
543
+ expect(comp._component.install).to include("([[ '/etc/init.d/service-test' -ef '/tmp/service-test' ]] || ln -s '/tmp/service-test' '/etc/init.d/service-test')")
544
+
545
+ # Look for defaultdir creation and copy
546
+ expect(comp._component.install).to include("install -d '/etc/default'")
547
+ expect(comp._component.install).to include("cp -p 'component-client.sysconfig' '/etc/default/service-test'")
548
+
549
+ # Look for files and configfiles
550
+ expect(comp._component.configfiles).to include(Vanagon::Common::Pathname.configfile('/etc/default/service-test'))
551
+ expect(comp._component.files).to include(Vanagon::Common::Pathname.file('/tmp/service-test', mode: '0755'))
552
+ expect(comp._component.files).to include(Vanagon::Common::Pathname.file('/etc/init.d/service-test'))
553
+
554
+ # The component should now have a service registered
555
+ expect(comp._component.service.name).to eq('service-test')
556
+ end
536
557
  end
537
558
 
538
559
  describe '#install_file' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-30 00:00:00.000000000 Z
11
+ date: 2017-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -237,42 +237,42 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  version: '0'
238
238
  requirements: []
239
239
  rubyforge_project:
240
- rubygems_version: 2.6.8
240
+ rubygems_version: 2.2.5
241
241
  signing_key:
242
242
  specification_version: 3
243
243
  summary: All of your packages will fit into this van with this one simple trick.
244
244
  test_files:
245
+ - spec/lib/makefile_spec.rb
245
246
  - spec/lib/vanagon/common/pathname_spec.rb
246
247
  - spec/lib/vanagon/common/user_spec.rb
248
+ - spec/lib/vanagon/component/dsl_spec.rb
249
+ - spec/lib/vanagon/component/rules_spec.rb
250
+ - spec/lib/vanagon/component/source/git_spec.rb
247
251
  - spec/lib/vanagon/component/source/http_spec.rb
248
252
  - spec/lib/vanagon/component/source/local_spec.rb
249
- - spec/lib/vanagon/component/source/git_spec.rb
250
253
  - spec/lib/vanagon/component/source_spec.rb
251
- - spec/lib/vanagon/component/dsl_spec.rb
252
- - spec/lib/vanagon/component/rules_spec.rb
253
- - spec/lib/vanagon/engine/base_spec.rb
254
+ - spec/lib/vanagon/component_spec.rb
255
+ - spec/lib/vanagon/driver_spec.rb
254
256
  - spec/lib/vanagon/engine/always_be_scheduling_spec.rb
257
+ - spec/lib/vanagon/engine/base_spec.rb
255
258
  - spec/lib/vanagon/engine/docker_spec.rb
256
259
  - spec/lib/vanagon/engine/ec2_spec.rb
257
260
  - spec/lib/vanagon/engine/hardware_spec.rb
258
261
  - spec/lib/vanagon/engine/local_spec.rb
259
262
  - spec/lib/vanagon/engine/pooler_spec.rb
260
- - spec/lib/vanagon/platform/solaris_11_spec.rb
263
+ - spec/lib/vanagon/environment_spec.rb
264
+ - spec/lib/vanagon/extensions/ostruct/json_spec.rb
265
+ - spec/lib/vanagon/extensions/set/json_spec.rb
266
+ - spec/lib/vanagon/extensions/string_spec.rb
267
+ - spec/lib/vanagon/optparse_spec.rb
261
268
  - spec/lib/vanagon/platform/deb_spec.rb
262
269
  - spec/lib/vanagon/platform/dsl_spec.rb
263
270
  - spec/lib/vanagon/platform/rpm/aix_spec.rb
264
271
  - spec/lib/vanagon/platform/rpm_spec.rb
272
+ - spec/lib/vanagon/platform/solaris_11_spec.rb
265
273
  - spec/lib/vanagon/platform/windows_spec.rb
266
- - spec/lib/vanagon/project/dsl_spec.rb
267
- - spec/lib/vanagon/extensions/ostruct/json_spec.rb
268
- - spec/lib/vanagon/extensions/set/json_spec.rb
269
- - spec/lib/vanagon/extensions/string_spec.rb
270
- - spec/lib/vanagon/optparse_spec.rb
271
274
  - spec/lib/vanagon/platform_spec.rb
275
+ - spec/lib/vanagon/project/dsl_spec.rb
272
276
  - spec/lib/vanagon/project_spec.rb
273
277
  - spec/lib/vanagon/utilities/shell_utilities_spec.rb
274
278
  - spec/lib/vanagon/utilities_spec.rb
275
- - spec/lib/vanagon/component_spec.rb
276
- - spec/lib/vanagon/driver_spec.rb
277
- - spec/lib/vanagon/environment_spec.rb
278
- - spec/lib/makefile_spec.rb