Skip to content

Commit b82a374

Browse files
committed
SAVEPOINT
1 parent 4f53fe7 commit b82a374

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tasks/docker.rake

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ namespace :docker do
219219
tag = target[:tag]
220220
platform = docker_platform
221221

222-
exec "docker run --rm -it --platform #{platform} -v #{Dir.pwd}:#{Dir.pwd} -w #{Dir.pwd} #{image}:#{tag}"
222+
version = tag =~ /^(\d+\.\d+)/ && $1
223+
engine = image =~ /([^\/]+)$/ && $1
224+
gemfile = "gemfiles/#{engine}-#{version}.gemfile"
225+
226+
exec "docker run --rm -it --platform #{platform} -v #{Dir.pwd}:#{Dir.pwd} -w #{Dir.pwd} -e BUNDLE_GEMFILE=#{Dir.pwd}/#{gemfile} #{image}:#{tag}"
223227
end
224228

225229
desc "Run container with shell."
@@ -230,7 +234,11 @@ namespace :docker do
230234
tag = target[:tag]
231235
platform = docker_platform
232236

233-
exec "docker run --rm -it --platform #{platform} -v #{Dir.pwd}:#{Dir.pwd} -w #{Dir.pwd} #{image}:#{tag} /bin/sh"
237+
version = tag =~ /^(\d+\.\d+)/ && $1
238+
engine = image =~ /([^\/]+)$/ && $1
239+
gemfile = "gemfiles/#{engine}-#{version}.gemfile"
240+
241+
exec "docker run --rm -it --platform #{platform} -v #{Dir.pwd}:#{Dir.pwd} -w #{Dir.pwd} -e BUNDLE_GEMFILE=#{Dir.pwd}/#{gemfile} #{image}:#{tag} /bin/sh"
234242
end
235243

236244
desc "Run container with irb."
@@ -241,6 +249,10 @@ namespace :docker do
241249
tag = target[:tag]
242250
platform = docker_platform
243251

244-
exec "docker run --rm -it --platform #{platform} -v #{Dir.pwd}:#{Dir.pwd} -w #{Dir.pwd} #{image}:#{tag} irb"
252+
version = tag =~ /^(\d+\.\d+)/ && $1
253+
engine = image =~ /([^\/]+)$/ && $1
254+
gemfile = "gemfiles/#{engine}-#{version}.gemfile"
255+
256+
exec "docker run --rm -it --platform #{platform} -v #{Dir.pwd}:#{Dir.pwd} -w #{Dir.pwd} -e BUNDLE_GEMFILE=#{Dir.pwd}/#{gemfile} #{image}:#{tag} irb"
245257
end
246258
end

0 commit comments

Comments
 (0)