pleme 0.0.27 → 0.0.28
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 +4 -4
- data/lib/pleme/gem/version.rb +1 -1
- data/lib/pleme/runner.rb +7 -32
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed3486742f359ccebe27c200b173b50785e1b9788f047923bc7569edc1ddde38
|
4
|
+
data.tar.gz: efdab6a5c78ba8aed53af100defd9165f8f4b9b930d2c902e5f9e31e651b366b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3673089ffaa70081cb3b9bc14cd6e0249380bd7bf7683c5ca650861a2eab0e73469f0ddfb505c3ee418b576e53666b4c6019044e2767edfa4b0b992061f3ca77
|
7
|
+
data.tar.gz: be6685acbe6366aef4d45a8e09c417a188612246491dfeca41ac439e00f98b36c1a6b1c109fa75dbee6699a01c4eb497a457a5db7dc8d72f6da30efa35d28bfd
|
data/lib/pleme/gem/version.rb
CHANGED
data/lib/pleme/runner.rb
CHANGED
@@ -35,11 +35,11 @@ class Runner
|
|
35
35
|
|
36
36
|
@spec = spec if @spec.nil?
|
37
37
|
dotfiles(spec) if spec[:dotfiles]
|
38
|
-
destroy(spec) if spec[:destroy]
|
39
|
-
apply(spec) if spec[:apply]
|
40
|
-
plan(spec) if spec[:plan]
|
41
38
|
|
42
|
-
|
39
|
+
if spec[:compose]
|
40
|
+
compose(:up) if spec[:up]
|
41
|
+
compose(:down) if spec[:down]
|
42
|
+
end
|
43
43
|
end
|
44
44
|
|
45
45
|
def read_config
|
@@ -51,24 +51,7 @@ class Runner
|
|
51
51
|
hax_portal
|
52
52
|
end
|
53
53
|
|
54
|
-
|
55
|
-
def dc(cmd, cwd = :cache)
|
56
|
-
cmd = "cd #{cwd} && docker-compose #{cmd}"
|
57
|
-
sh "mkdir -p #{cwd}" unless Dir.exist?(cwd)
|
58
|
-
sh cmd
|
59
|
-
end
|
60
|
-
|
61
|
-
# shell interface for terraform
|
62
|
-
def tf(cmd, cwd = :cache)
|
63
|
-
sh "mkdir -p #{cwd}" unless Dir.exist?(cwd.to_s)
|
64
|
-
cmd = "cd #{cwd} && terraform #{cmd}"
|
65
|
-
@translator.eval_in_context(File.read(@config_path))
|
66
|
-
sh cmd
|
67
|
-
sh "rm -rf #{File.join(cmd, 'template.json')}"
|
68
|
-
end
|
69
|
-
|
70
|
-
def apply(_spec)
|
71
|
-
cwd = :cache
|
54
|
+
def compose(direction)
|
72
55
|
config = read_config
|
73
56
|
$logger.info config
|
74
57
|
config[:pleme][:environment].keys.each do |env|
|
@@ -76,21 +59,13 @@ class Runner
|
|
76
59
|
case param
|
77
60
|
when :compose
|
78
61
|
$logger.info env
|
79
|
-
File.write(yamilify(config[:pleme][:environment][env][:compose]),
|
80
|
-
sh
|
62
|
+
File.write(yamilify(config[:pleme][:environment][env][:compose]), 'docker-compose.yml')
|
63
|
+
sh "docker-compose #{direction}"
|
81
64
|
end
|
82
65
|
end
|
83
66
|
end
|
84
67
|
end
|
85
68
|
|
86
|
-
# def plan(_spec)
|
87
|
-
# tf 'plan'
|
88
|
-
# end
|
89
|
-
|
90
|
-
# def destroy(_spec)
|
91
|
-
# tf 'destroy'
|
92
|
-
# end
|
93
|
-
|
94
69
|
# read a local file into this space
|
95
70
|
# so you can test locally while importing
|
96
71
|
# good code to this class
|