docker-rails 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/docker/rails/app.rb +44 -36
- data/lib/docker/rails/cli/main.rb +5 -13
- data/lib/docker/rails/version.rb +1 -1
- 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: c15e19eedac4b56ec333ef623365115d04359dbb
|
4
|
+
data.tar.gz: 8a9ee44313c4ef3dc653d445563920881d30c6e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1eb936a2fdfdbbd12d54f788f08a789b765fc66f03be04113e542527688ca00f54c063939d2b68abb0faadd605e820ea56a9115246286d171bbdeeafee39205
|
7
|
+
data.tar.gz: 930ee9bac8c4cbc077573ac6179519475524bcabfd5696af8cb17d99c884f2775d815a40c936d87a2a92a03d63807acb81e0f6d794f82a541289b0d2195fe96e
|
data/README.md
CHANGED
@@ -176,8 +176,8 @@ COPY Gemfile Gemfile
|
|
176
176
|
COPY Gemfile_shared.rb Gemfile_shared.rb
|
177
177
|
COPY spec/dummy/Gemfile spec/dummy/Gemfile
|
178
178
|
# This is only here to trigger re-bundle when lock changes, we actually only use the ImageGemfile.lock so that we are
|
179
|
-
# always doing a fresh bundle anytime the source lock changes.
|
180
|
-
COPY Gemfile.lock
|
179
|
+
# always doing a fresh bundle anytime the source lock changes. Only keep the dummy lock in the repo, not the engine lock.
|
180
|
+
COPY spec/dummy/Gemfile.lock spec/dummy/Gemfile.lock
|
181
181
|
|
182
182
|
# Bundle acme and the dummy app
|
183
183
|
RUN \
|
data/lib/docker/rails/app.rb
CHANGED
@@ -164,6 +164,14 @@ module Docker
|
|
164
164
|
exec_compose 'up', false, options #unless skip? :up
|
165
165
|
end
|
166
166
|
|
167
|
+
def down(options = '')
|
168
|
+
# `compose down` doesn't support force removing images, so we use `rm --force`
|
169
|
+
exec_compose 'rm', false, '--force -v'
|
170
|
+
|
171
|
+
# Stop and remove all the linked services and network
|
172
|
+
exec_compose 'down', false, options
|
173
|
+
end
|
174
|
+
|
167
175
|
def compose_build
|
168
176
|
# Run the compose configuration
|
169
177
|
exec_compose 'build'
|
@@ -180,42 +188,42 @@ module Docker
|
|
180
188
|
exec 'docker ps -a'
|
181
189
|
end
|
182
190
|
|
183
|
-
def stop_all
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
end
|
204
|
-
|
205
|
-
def rm_volumes
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
end
|
191
|
+
# def stop_all
|
192
|
+
# puts "\n\n\n\nStopping containers..."
|
193
|
+
# puts '-----------------------------'
|
194
|
+
# containers = Docker::Container.all(all: true)
|
195
|
+
# containers.each do |container|
|
196
|
+
# if is_project_container?(container)
|
197
|
+
# stop(container)
|
198
|
+
#
|
199
|
+
# service_name = container.compose.service
|
200
|
+
# if @config['exit_code'].eql?(service_name)
|
201
|
+
# if container.up?
|
202
|
+
# puts "Unable to determine exit code, the #{service_name} is still up, current status: #{container.status}"
|
203
|
+
# @exit_code = -999
|
204
|
+
# else
|
205
|
+
# @exit_code = container.exit_code
|
206
|
+
# end
|
207
|
+
# end
|
208
|
+
# end
|
209
|
+
# end
|
210
|
+
# puts 'Done.'
|
211
|
+
# end
|
212
|
+
|
213
|
+
# def rm_volumes
|
214
|
+
# puts "\n\nRemoving container volumes..."
|
215
|
+
# puts '-----------------------------'
|
216
|
+
#
|
217
|
+
# # http://docs.docker.com/v1.7/reference/api/docker_remote_api_v1.19/#remove-a-container
|
218
|
+
# containers = Docker::Container.all(all: true)
|
219
|
+
# containers.each do |container|
|
220
|
+
# if is_project_container?(container)
|
221
|
+
# puts container.name
|
222
|
+
# rm_v(container)
|
223
|
+
# end
|
224
|
+
# end
|
225
|
+
# puts 'Done.'
|
226
|
+
# end
|
219
227
|
|
220
228
|
def rm_dangling
|
221
229
|
puts "\n\nCleaning up dangling images..."
|
@@ -41,13 +41,12 @@ module Docker
|
|
41
41
|
app.extract_all
|
42
42
|
end
|
43
43
|
|
44
|
-
desc 'cleanup <target>', 'Runs container cleanup functions
|
44
|
+
desc 'cleanup <target>', 'Runs container cleanup functions extract, down, rm_compose, rm_dangling, ps_all e.g. docker-rails cleanup --build=222 development'
|
45
45
|
option :extract, aliases: ['-e'], type: :boolean, default: true, desc: 'Extract any directories defined in configuration.'
|
46
46
|
|
47
47
|
def cleanup(target)
|
48
|
-
invoke :stop
|
49
48
|
invoke :extract if options[:extract]
|
50
|
-
invoke :
|
49
|
+
invoke :down
|
51
50
|
invoke :rm_compose
|
52
51
|
# invoke :rm_dangling # causes a brand new dockerfile build - don't do that. See https://github.com/alienfast/docker-rails/issues/26
|
53
52
|
invoke :ps_all
|
@@ -100,18 +99,11 @@ module Docker
|
|
100
99
|
app.before_command
|
101
100
|
end
|
102
101
|
|
103
|
-
desc '
|
102
|
+
desc 'down <target>', 'Stop and cleanup all running containers for the given build/target e.g. docker-rails down --build=222 development'
|
104
103
|
|
105
|
-
def
|
104
|
+
def down(target)
|
106
105
|
invoke :compose
|
107
|
-
App.configured(target, options).
|
108
|
-
end
|
109
|
-
|
110
|
-
desc 'rm_volumes <target>', 'Stop all running containers and remove corresponding volumes for the given build/target e.g. docker-rails rm_volumes --build=222 development'
|
111
|
-
|
112
|
-
def rm_volumes(target)
|
113
|
-
invoke :stop
|
114
|
-
App.configured(target, options).rm_volumes
|
106
|
+
App.configured(target, options).down
|
115
107
|
end
|
116
108
|
|
117
109
|
desc 'rm_compose', 'Remove generated docker_compose file e.g. docker-rails rm_compose --build=222 development', hide: true
|
data/lib/docker/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Ross
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|