pleme 0.0.13 → 0.0.18

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
  SHA256:
3
- metadata.gz: 3aa34c687cbb042f96d2da6a998cc8a78e9aea4d331c0dc8475b669f9c7f50a3
4
- data.tar.gz: 498ff439fd7a1861209f2c57c15f5017156466e7ce3294e872e87628447359e6
3
+ metadata.gz: 4b7215fb855677c01859eddb739d9a01b8614da1844bd33b85464306b523b5a7
4
+ data.tar.gz: 0646d9d35a42be800cdc4264a0419b48b1a312c935b898045987680ab2ff6167
5
5
  SHA512:
6
- metadata.gz: 946508e84d1466b1374858076f3e520642d43ac176128d0d53105be2b10906abd1d9198efdb36e42850cd833e81698543b0a43606dc4c7363667bf6274a32470
7
- data.tar.gz: ee9305835a9683c8e922a806a3353fccaad2f3f9e077636078e2a4aaaee269a7209ba4bb1d57875e5d39ee2503d1ae121fa6eb2cc384ee9d4f3944c026e08738
6
+ metadata.gz: fee752140c800e9369f80f47c245068913541e7f957ccc7999faa4efb62e7fbed53ca799d8c07cf6ec268901debe5eea989c4fe38b7f42b1ec3017d5c533f481
7
+ data.tar.gz: 27992c6f9f60ec51d027e456b42564cab5a224cb193b9b0ceb36a2f89c6b073c3fe9db1396ca5e9b072553b04ce14baa51df0dab0d4ddc5f6489760756102420
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pleme
4
4
  module Gem
5
- VERSION = '0.0.13'
5
+ VERSION = '0.0.18'
6
6
  end
7
7
  end
@@ -11,9 +11,9 @@ require 'json'
11
11
 
12
12
  class Runner
13
13
  def initialize
14
- @translator = PlemecTranslator.new
15
- @spec = nil
16
- @config_path = 'plemec.rb'
14
+ @config_path = 'plemec.rb'
15
+ @translator = PlemecTranslator.new
16
+ @spec = nil
17
17
  end
18
18
 
19
19
  # run a shell command
@@ -38,39 +38,23 @@ class Runner
38
38
 
39
39
  def read_config
40
40
  @translator.eval_in_context(File.read(@config_path))
41
- @translator.inspect
41
+ @translator.translation.inspect
42
42
  end
43
43
 
44
44
  def dotfiles(_spec)
45
45
  hax_portal
46
46
  end
47
47
 
48
- def docker_compose(cwd = :cache)
49
- sh "mkdir -p #{cwd}" unless Dir.exist?(cwd)
50
- end
51
-
52
48
  # shell interface for docker-compose
53
49
  def dc(cmd, cwd = :cache)
54
- sh "mkdir -p #{cwd}" unless Dir.exist?(cwd)
55
- @translator.eval_in_context(File.read(@config_path))
56
50
  cmd = "cd #{cwd} && docker-compose #{cmd}"
57
- @translator.inspect[:pleme].keys.each do |pkey|
58
- pkey = pkey.to_sym if pkey.instance_of?(String)
59
- next unless pkey.eql? :compose
60
-
61
- @translator.inspect[:pleme][:environment].keys.each do |env|
62
- File.write(
63
- yamilify(inspect[:pleme][:environment][env][:compose]),
64
- File.join(cwd, 'docker-compose.yml')
65
- )
66
- end
67
- end
51
+ sh "mkdir -p #{cwd}" unless Dir.exist?(cwd)
68
52
  sh cmd
69
53
  end
70
54
 
71
55
  # shell interface for terraform
72
56
  def tf(cmd, cwd = :cache)
73
- sh "mkdir -p #{cwd}" unless Dir.exist?(cwd)
57
+ sh "mkdir -p #{cwd}" unless Dir.exist?(cwd.to_s)
74
58
  cmd = "cd #{cwd} && terraform #{cmd}"
75
59
  @translator.eval_in_context(File.read(@config_path))
76
60
  sh cmd
@@ -78,16 +62,30 @@ class Runner
78
62
  end
79
63
 
80
64
  def apply(_spec)
81
- tf 'apply'
65
+ config = read_config
66
+ puts config
67
+ config[:pleme].keys.each do |pkey|
68
+ pkey = pkey.to_sym if pkey.instance_of?(String)
69
+ case pkey
70
+ when :compose
71
+ @translator.inspect[:pleme][:environment].keys.each do |env|
72
+ File.write(
73
+ yamilify(config[:pleme][:environment][env][:compose]),
74
+ File.join(cwd, 'docker-compose.yml')
75
+ )
76
+ sh 'docker-compose up'
77
+ end
78
+ end
79
+ end
82
80
  end
83
81
 
84
- def plan(_spec)
85
- tf 'plan'
86
- end
82
+ # def plan(_spec)
83
+ # tf 'plan'
84
+ # end
87
85
 
88
- def destroy(_spec)
89
- tf 'destroy'
90
- end
86
+ # def destroy(_spec)
87
+ # tf 'destroy'
88
+ # end
91
89
 
92
90
  # read a local file into this space
93
91
  # so you can test locally while importing
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pleme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''