egg 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/lib/egg/dockerfile/base.rb +15 -3
- data/lib/egg/dockerfile/node_js.rb +1 -2
- data/lib/egg/dockerfile/ruby.rb +1 -2
- data/lib/egg/version.rb +1 -1
- data/templates/.dockerignore +2 -1
- data/templates/egg_config.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d75e3a224f4e96b79ba91e6e62b43b46efed0f15
|
4
|
+
data.tar.gz: 835698e87464bf1fe70cbcdb3bfa910c7c4c1054
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed225dc0cc7953ab54988a3d337147d9f9e6bdac9a24a589b749f81d223fb512dc68a2fc52a8292c2d973bbaad21041611e284ec1fa8dc1fddac18a4df36b7e2
|
7
|
+
data.tar.gz: fab3916a82f6eff8524a9c4c9f7de4ade7c1a32c922ef070e7a4726c2fc1dbff1cf8bfe89919fd7f196a38c5dd34068d7f3c557427a5f2af09ea0752f71ebf74
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -14,7 +14,7 @@ Maintainers:
|
|
14
14
|
* [Jason Sisk](https://github.com/sisk)
|
15
15
|
|
16
16
|
This gem is currently heavily focused on Ruby and Rails projects relevant within
|
17
|
-
the
|
17
|
+
the Hatch organization. The eventual goal is for this to become language and
|
18
18
|
framework agnostic, though the configuration language will be Ruby.
|
19
19
|
|
20
20
|
## Installation
|
data/lib/egg/dockerfile/base.rb
CHANGED
@@ -18,9 +18,7 @@ module Egg
|
|
18
18
|
raise(MissingPropertyError, "Must populate #{attr}") if send(attr).nil?
|
19
19
|
end
|
20
20
|
|
21
|
-
unrendered_output =
|
22
|
-
out << command.to_s.upcase << " " << string << "\n"
|
23
|
-
end
|
21
|
+
unrendered_output = compile_unrendered_output
|
24
22
|
|
25
23
|
ERB.new(unrendered_output).result(binding)
|
26
24
|
end
|
@@ -29,6 +27,13 @@ module Egg
|
|
29
27
|
template.insert(do_before(before), [:run, command])
|
30
28
|
end
|
31
29
|
|
30
|
+
def env(env_hash)
|
31
|
+
env_string = env_hash.reduce("") do |out, (key, value)|
|
32
|
+
out << key.to_s.upcase << '="' << value.to_s << '" '
|
33
|
+
end
|
34
|
+
template << [:env, env_string]
|
35
|
+
end
|
36
|
+
|
32
37
|
private
|
33
38
|
|
34
39
|
def do_before(before)
|
@@ -36,6 +41,13 @@ module Egg
|
|
36
41
|
template.index { |tc| tc[0] == before[0] } ||
|
37
42
|
-1
|
38
43
|
end
|
44
|
+
|
45
|
+
def compile_unrendered_output
|
46
|
+
final_template = template << [:cmd, "<%= command %>"]
|
47
|
+
final_template.reduce("") do |out, (command, string)|
|
48
|
+
out << command.to_s.upcase << " " << string << "\n"
|
49
|
+
end
|
50
|
+
end
|
39
51
|
end
|
40
52
|
end
|
41
53
|
end
|
data/lib/egg/dockerfile/ruby.rb
CHANGED
@@ -29,8 +29,7 @@ module Egg
|
|
29
29
|
[:add, "Gemfile* $APP_HOME/"],
|
30
30
|
[:env, "BUNDLE_GEMFILE=$APP_HOME/Gemfile BUNDLE_JOBS=4 BUNDLE_WITHOUT=production:staging"],
|
31
31
|
[:run, "bundle install"],
|
32
|
-
[:add, ". $APP_HOME"]
|
33
|
-
[:cmd, "<%= command %>"]
|
32
|
+
[:add, ". $APP_HOME"]
|
34
33
|
]
|
35
34
|
end
|
36
35
|
end
|
data/lib/egg/version.rb
CHANGED
data/templates/.dockerignore
CHANGED
data/templates/egg_config.rb
CHANGED
@@ -8,6 +8,7 @@ Egg::Configuration.new do |config|
|
|
8
8
|
# self.dockerfile = Dockerfile.use "Ruby"
|
9
9
|
# self.dockerfile.ruby_version = "2.4.0"
|
10
10
|
# self.dockerfile.command = "bin/rails server -p 3000"
|
11
|
+
# self.dockerfile.env(dotenv.env)
|
11
12
|
|
12
13
|
# Example docker_compose config:
|
13
14
|
# app = config.docker_compose.service "app"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: egg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Thuringer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-09-
|
12
|
+
date: 2017-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|