cm 0.1.2 → 0.1.3

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: 612408e4e1eacb4a4ab884c3933ff1560d194742
4
- data.tar.gz: e13c7db9e033306b3b2298628f694ceb72e1c519
3
+ metadata.gz: 9d05228dd289bffb3d2c8be98aad43c5b5fa57fa
4
+ data.tar.gz: 40b139ff6302463f604cafb6a2ae76a378c9d001
5
5
  SHA512:
6
- metadata.gz: 314006b3132f68f9b6b1f2a2801d763ae87c8baee1f17bd0e5b41b8c205ff8f7bae9d0e338748858d9e2f3c21bd8f8f78aa8ac4d3019e82ceaa34fb050f2eea0
7
- data.tar.gz: 4ea71fa39e3df24f944c0a6cb8ed1820d7494c669e930c91f5995fa2a0d3821e050d3042b1ae693151faa027d9c855872553e5d806aafe620592a06b0e130bf2
6
+ metadata.gz: 094fe4e3533a99cb4893bad66e79fb4cb9804b4009fa90ec06920f843267b82f6879b07401b2bb97cff569700e94970b796d7bed82a9a58016c8534f138b442d
7
+ data.tar.gz: 2f90ff99791b7b60a51deb6c2b9dbae728771a7773438e07b1882a0be61af959b52c688a8a8d5355ec206ad08ab0b5f5c2fc8febd6fa8e2066e341bc31442e16
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
data/bin/cm CHANGED
@@ -9,7 +9,7 @@ begin
9
9
  class Parser
10
10
  def version
11
11
  version = CM.VERSION
12
- "CM: #{version} (Apache License, Version 2.0) -- https://github.com/adrianwebb/cm/tree/v#{version}"
12
+ "cm: #{version} (Apache License, Version 2.0) -- https://github.com/adrianwebb/cm/tree/v#{version}"
13
13
  end
14
14
  end
15
15
  end; end; end
data/cm.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: cm 0.1.2 ruby lib
5
+ # stub: cm 0.1.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "cm"
9
- s.version = "0.1.2"
9
+ s.version = "0.1.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Adrian Webb"]
14
- s.date = "2015-12-05"
14
+ s.date = "2015-12-09"
15
15
  s.description = "\nPluggable cloud management framework that provides a simple foundation for\ndeploying and destroying enterprise ready cloud environments and components\nthat integrate; cloud provider components and services, cloud orchestration\nand configuration management tools, and continuous integration and delivery\npipelines.\n"
16
16
  s.email = "adrian.webb@gsa.gov"
17
17
  s.executables = ["cm"]
@@ -26,13 +26,31 @@ Gem::Specification.new do |s|
26
26
  "VERSION",
27
27
  "bin/cm",
28
28
  "cm.gemspec",
29
+ "lib/CM/batch/celluloid.rb",
30
+ "lib/CM/configuration/directory.rb",
31
+ "lib/CM/configuration/file.rb",
32
+ "lib/CM/job/AWS.rb",
33
+ "lib/CM/job/BOSH.rb",
34
+ "lib/CM/job/concourse.rb",
35
+ "lib/CM/job/keypair.rb",
36
+ "lib/CM/job/variables.rb",
37
+ "lib/CM/plan/default.rb",
38
+ "lib/CM/sequence/default.rb",
29
39
  "lib/cm.rb",
30
40
  "lib/core/errors.rb",
31
41
  "lib/core/facade.rb",
32
42
  "lib/core/mixin/action/config.rb",
43
+ "lib/core/mixin/action/registration.rb",
33
44
  "lib/core/overrides.rb",
45
+ "lib/core/plugin/batch.rb",
34
46
  "lib/core/plugin/cm_action.rb",
47
+ "lib/core/plugin/configuration.rb",
48
+ "lib/core/plugin/disk_configuration.rb",
49
+ "lib/core/plugin/job.rb",
50
+ "lib/core/plugin/parallel_base.rb",
51
+ "lib/core/plugin/plan.rb",
35
52
  "lib/core/plugin/plan_action.rb",
53
+ "lib/core/plugin/sequence.rb",
36
54
  "lib/nucleon/action/plan/deploy.rb",
37
55
  "lib/nucleon/action/plan/destroy.rb",
38
56
  "locales/en.yml",
@@ -0,0 +1,38 @@
1
+
2
+ module CM
3
+ module Batch
4
+ class Celluloid < Nucleon.plugin_class(:CM, :batch)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Plugin interface
8
+
9
+ def normalize(reload)
10
+ super
11
+ yield if block_given?
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Checks
16
+
17
+ #-----------------------------------------------------------------------------
18
+ # Property accessors / modifiers
19
+
20
+ #-----------------------------------------------------------------------------
21
+ # Operations
22
+
23
+ #-----------------------------------------------------------------------------
24
+ # Utilities
25
+
26
+ def execute_parallel
27
+ values = []
28
+ jobs.each do |job|
29
+ values << Celluloid::Future.new(job) do
30
+ job.execute(sequence.settings)
31
+ end
32
+ end
33
+ values = values.map { |future| future.value }
34
+ !values.include?(false)
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,70 @@
1
+
2
+ module CM
3
+ module Configuration
4
+ class Directory < Nucleon.plugin_class(:CM, :disk_configuration)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Plugin interface
8
+
9
+ def normalize(reload)
10
+ super
11
+ yield if block_given?
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Checks
16
+
17
+ def initialized?(options = {})
18
+ ::File.directory?(path)
19
+ end
20
+
21
+ #-----------------------------------------------------------------------------
22
+ # Property accessors / modifiers
23
+
24
+ def output_file
25
+ _get(:output_file, 'rendered.config.yaml')
26
+ end
27
+
28
+ def target_path
29
+ ::File.join(path, output_file)
30
+ end
31
+
32
+ #-----------------------------------------------------------------------------
33
+ # Operations
34
+
35
+ def parse(wipe = true)
36
+ super do
37
+ import_directory(path)
38
+ end
39
+ end
40
+
41
+ #---
42
+
43
+ def save
44
+ super do
45
+ save_config(target_path, export)
46
+ end
47
+ end
48
+
49
+ #-----------------------------------------------------------------------------
50
+ # Utilities
51
+
52
+ def import_directory(directory, force = true, deep_merge = true)
53
+ success = true
54
+
55
+ Nucleon.loaded_plugins(:nucleon, :translator).each do |provider, info|
56
+ Dir.glob(::File.join(directory, '**', "*.#{provider}")).each do |file|
57
+ logger.debug("Merging configurations from: #{file}")
58
+ if config_data = parse_config(file)
59
+ import(config_data, { :force => force, :basic => !deep_merge })
60
+ else
61
+ success = false
62
+ end
63
+ end
64
+ end
65
+ success
66
+ end
67
+ protected :import_directory
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,56 @@
1
+
2
+ module CM
3
+ module Configuration
4
+ class File < Nucleon.plugin_class(:CM, :disk_configuration)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Plugin interface
8
+
9
+ def normalize(reload)
10
+ super
11
+ yield if block_given?
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Checks
16
+
17
+ def initialized?(options = {})
18
+ path && ::File.exist?(path)
19
+ end
20
+
21
+ #-----------------------------------------------------------------------------
22
+ # Property accessors / modifiers
23
+
24
+ #-----------------------------------------------------------------------------
25
+ # Operations
26
+
27
+ def parse(wipe = true)
28
+ super do
29
+ import_file(path)
30
+ end
31
+ end
32
+
33
+ #---
34
+
35
+ def save
36
+ super do
37
+ save_config(path, export)
38
+ end
39
+ end
40
+
41
+ #-----------------------------------------------------------------------------
42
+ # Utilities
43
+
44
+ def import_file(file, force = true, deep_merge = true)
45
+ success = true
46
+ if config_data = parse_config(file)
47
+ import(config_data, { :force => force, :basic => !deep_merge })
48
+ else
49
+ success = false
50
+ end
51
+ success
52
+ end
53
+ protected :import_file
54
+ end
55
+ end
56
+ end
data/lib/CM/job/AWS.rb ADDED
@@ -0,0 +1,32 @@
1
+
2
+ module CM
3
+ module Job
4
+ class AWS < Nucleon.plugin_class(:CM, :job)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Plugin interface
8
+
9
+ def normalize(reload)
10
+ super
11
+ yield if block_given?
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Checks
16
+
17
+ def initialized?(options = {})
18
+ true
19
+ end
20
+
21
+ #-----------------------------------------------------------------------------
22
+ # Property accessors / modifiers
23
+
24
+ #-----------------------------------------------------------------------------
25
+ # Operations
26
+
27
+ #-----------------------------------------------------------------------------
28
+ # Utilities
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+
2
+ module CM
3
+ module Job
4
+ class BOSH < Nucleon.plugin_class(:CM, :job)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Plugin interface
8
+
9
+ def normalize(reload)
10
+ super
11
+ yield if block_given?
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Checks
16
+
17
+ def initialized?(options = {})
18
+ true
19
+ end
20
+
21
+ #-----------------------------------------------------------------------------
22
+ # Property accessors / modifiers
23
+
24
+ #-----------------------------------------------------------------------------
25
+ # Operations
26
+
27
+ #-----------------------------------------------------------------------------
28
+ # Utilities
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+
2
+ module CM
3
+ module Job
4
+ class Concourse < Nucleon.plugin_class(:CM, :job)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Plugin interface
8
+
9
+ def normalize(reload)
10
+ super
11
+ yield if block_given?
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Checks
16
+
17
+ def initialized?(options = {})
18
+ true
19
+ end
20
+
21
+ #-----------------------------------------------------------------------------
22
+ # Property accessors / modifiers
23
+
24
+ #-----------------------------------------------------------------------------
25
+ # Operations
26
+
27
+ #-----------------------------------------------------------------------------
28
+ # Utilities
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+
2
+ module CM
3
+ module Job
4
+ class Keypair < Nucleon.plugin_class(:CM, :job)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Plugin interface
8
+
9
+ def normalize(reload)
10
+ super
11
+ yield if block_given?
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Checks
16
+
17
+ def initialized?(options = {})
18
+ true
19
+ end
20
+
21
+ #-----------------------------------------------------------------------------
22
+ # Property accessors / modifiers
23
+
24
+ #-----------------------------------------------------------------------------
25
+ # Operations
26
+
27
+ #-----------------------------------------------------------------------------
28
+ # Utilities
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+
2
+ module CM
3
+ module Job
4
+ class Variables < Nucleon.plugin_class(:CM, :job)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Plugin interface
8
+
9
+ def normalize(reload)
10
+ super
11
+ yield if block_given?
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Checks
16
+
17
+ def initialized?(options = {})
18
+ true
19
+ end
20
+
21
+ #-----------------------------------------------------------------------------
22
+ # Property accessors / modifiers
23
+
24
+ #-----------------------------------------------------------------------------
25
+ # Operations
26
+
27
+ #-----------------------------------------------------------------------------
28
+ # Utilities
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,28 @@
1
+
2
+ module CM
3
+ module Plan
4
+ class Default < Nucleon.plugin_class(:CM, :plan)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Plugin interface
8
+
9
+ def normalize(reload)
10
+ super
11
+ yield if block_given?
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Checks
16
+
17
+ #-----------------------------------------------------------------------------
18
+ # Property accessors / modifiers
19
+
20
+ #-----------------------------------------------------------------------------
21
+ # Operations
22
+
23
+ #-----------------------------------------------------------------------------
24
+ # Utilities
25
+
26
+ end
27
+ end
28
+ end