egg 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +1 -1
- data/lib/egg.rb +0 -1
- data/lib/egg/cli.rb +0 -1
- data/lib/egg/configuration.rb +2 -15
- data/lib/egg/version.rb +1 -1
- metadata +3 -6
- data/lib/egg/docker_compose.rb +0 -35
- data/lib/egg/docker_compose/service.rb +0 -41
- data/templates/docker-compose.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 32bcf99fe8e9537b1e235446d51b86eccfaaf810a7340e70b0d6f526a2a59d4d
|
4
|
+
data.tar.gz: dd3fb8262550cd37467f042596b4dc4afa6b0639438e42cc769c678107e3345d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be762f48f2481312dc4bb5aedacf18ab11180b7524d4170ae56fa47c5acbed548b9ae2b4e28dd5660499fe92900e494a95c6dbb0cc6301b741f91b86329a4857
|
7
|
+
data.tar.gz: bf527d2016aa0553b048cc890c14a415cffc2dea656dbf0048da7da7f2a233b76772f40862ca30593c39513abe3905f74165906547f00a2b5e311c1c405edc8f
|
data/Gemfile.lock
CHANGED
data/lib/egg.rb
CHANGED
data/lib/egg/cli.rb
CHANGED
data/lib/egg/configuration.rb
CHANGED
@@ -22,17 +22,13 @@ module Egg
|
|
22
22
|
warn e.backtrace.join("\n")
|
23
23
|
end
|
24
24
|
|
25
|
-
attr_accessor :
|
26
|
-
:ssh_support,
|
27
|
-
:ruby_version,
|
25
|
+
attr_accessor :ssh_support,
|
28
26
|
:supervisor,
|
29
27
|
:dotenv
|
30
28
|
|
31
29
|
def initialize(&configuration_block)
|
32
|
-
self.docker_compose = DockerCompose.new
|
33
30
|
self.ssh_support = false
|
34
|
-
self.
|
35
|
-
self.dotenv = DotenvUtil.new(File.read(".env.template"))
|
31
|
+
self.dotenv = DotenvUtil.new(File.read(".env.template")) if File.exist?(".env.template")
|
36
32
|
instance_eval(&configuration_block)
|
37
33
|
self
|
38
34
|
end
|
@@ -64,19 +60,10 @@ module Egg
|
|
64
60
|
end
|
65
61
|
|
66
62
|
def run_setup
|
67
|
-
write_docker_files
|
68
|
-
|
69
63
|
docker_pull_build
|
70
|
-
File.write(".env", dotenv.generate_env)
|
71
|
-
|
72
64
|
run_after_startup
|
73
65
|
end
|
74
66
|
|
75
|
-
def write_docker_files
|
76
|
-
dockerignore = Templates[".dockerignore"].result(binding)
|
77
|
-
File.write(".dockerignore", dockerignore)
|
78
|
-
end
|
79
|
-
|
80
67
|
def docker_pull_build
|
81
68
|
system("docker-compose pull")
|
82
69
|
system("docker-compose build") || raise($CHILD_STATUS)
|
data/lib/egg/version.rb
CHANGED
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.10.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:
|
12
|
+
date: 2018-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -145,12 +145,9 @@ files:
|
|
145
145
|
- lib/egg.rb
|
146
146
|
- lib/egg/cli.rb
|
147
147
|
- lib/egg/configuration.rb
|
148
|
-
- lib/egg/docker_compose.rb
|
149
|
-
- lib/egg/docker_compose/service.rb
|
150
148
|
- lib/egg/templates.rb
|
151
149
|
- lib/egg/version.rb
|
152
150
|
- templates/.dockerignore
|
153
|
-
- templates/docker-compose.yml
|
154
151
|
- templates/egg_config.rb
|
155
152
|
- templates/supervisord.conf
|
156
153
|
homepage: http://github.com/bellycard/egg
|
@@ -174,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
171
|
version: '0'
|
175
172
|
requirements: []
|
176
173
|
rubyforge_project:
|
177
|
-
rubygems_version: 2.
|
174
|
+
rubygems_version: 2.7.3
|
178
175
|
signing_key:
|
179
176
|
specification_version: 4
|
180
177
|
summary: Egg helps you develop with Docker!
|
data/lib/egg/docker_compose.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "yaml"
|
4
|
-
|
5
|
-
# Wraps the generation of Docker Compose file
|
6
|
-
class DockerCompose
|
7
|
-
attr_reader :docker_compose,
|
8
|
-
:services
|
9
|
-
|
10
|
-
def initialize(_compose_config = {})
|
11
|
-
@services = []
|
12
|
-
print "Use of docker_compose is deprecated. Please craft the docker-compose.yml file yourself. This module will be dropped in a future egg."
|
13
|
-
end
|
14
|
-
|
15
|
-
def configure
|
16
|
-
yield docker_compose
|
17
|
-
end
|
18
|
-
|
19
|
-
def to_yaml
|
20
|
-
output = { "version" => "2" }
|
21
|
-
output["services"] = services.each_with_object({}) do |service, hash|
|
22
|
-
hash[service.name] = service.to_hash
|
23
|
-
end
|
24
|
-
|
25
|
-
output.to_yaml
|
26
|
-
end
|
27
|
-
|
28
|
-
def service(name)
|
29
|
-
service = Service.new(name)
|
30
|
-
services << service
|
31
|
-
service
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
require_relative "docker_compose/service"
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class DockerCompose
|
4
|
-
# Wraps the definition of docker-compose services
|
5
|
-
class Service
|
6
|
-
attr_reader :name, :links, :environment
|
7
|
-
attr_accessor :dockerfile,
|
8
|
-
:command,
|
9
|
-
:ports,
|
10
|
-
:volumes,
|
11
|
-
:image
|
12
|
-
|
13
|
-
def initialize(name)
|
14
|
-
@name = name
|
15
|
-
|
16
|
-
@links = []
|
17
|
-
@environment = []
|
18
|
-
end
|
19
|
-
|
20
|
-
def link(service)
|
21
|
-
@links << service.name
|
22
|
-
end
|
23
|
-
|
24
|
-
def env(variable, value)
|
25
|
-
@environment << "#{variable}=#{value}"
|
26
|
-
end
|
27
|
-
|
28
|
-
def to_hash
|
29
|
-
output = {
|
30
|
-
"environment" => environment,
|
31
|
-
"links" => links,
|
32
|
-
"volumes" => volumes,
|
33
|
-
"ports" => ports
|
34
|
-
}
|
35
|
-
|
36
|
-
image ? output["image"] = image : output["build"] = "."
|
37
|
-
output["command"] = command if command
|
38
|
-
output.each_with_object({}) { |(k, v), hash| hash[k] = v if v }
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|