Skip to content

Commit

Permalink
feat(rake): add command to build all container at once
Browse files Browse the repository at this point in the history
  • Loading branch information
marian13 committed Sep 22, 2022
1 parent 6ec14e6 commit e3318a3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

require "bundler/gem_tasks"

##
# IMPORTANT: All rake tasks listed in this file should be executed from the root folder.
#

##
# Prints a shell command and then executes it.
#
Expand All @@ -23,7 +27,7 @@ def run(command)
success = system command

##
# NOTE: Forces `rake' to exit immediately if any of its `run' commands return a non-zero status.
# NOTE: Forces rake to exit immediately if any of its `run' commands return a non-zero status.
#
exit(1) unless success
end
Expand Down Expand Up @@ -99,6 +103,12 @@ namespace :dry do
end

namespace :docker do
task :build do
run %(docker build . -f docker/2.7/Dockerfile -t convenient_service:2.7)
run %(docker build . -f docker/3.0/Dockerfile -t convenient_service:3.0)
run %(docker build . -f docker/3.1/Dockerfile -t convenient_service:3.1)
end

namespace :"ruby_2.7" do
task :build do
run %(docker build . -f docker/2.7/Dockerfile -t convenient_service:2.7)
Expand All @@ -108,9 +118,7 @@ namespace :docker do
run %(docker run --rm -it -v $(pwd):/gem convenient_service:2.7 bash)
end
end
end

namespace :docker do
namespace :"ruby_3.0" do
task :build do
run %(docker build . -f docker/3.0/Dockerfile -t convenient_service:3.0)
Expand All @@ -120,9 +128,7 @@ namespace :docker do
run %(docker run --rm -it -v $(pwd):/gem convenient_service:3.0 bash)
end
end
end

namespace :docker do
namespace :"ruby_3.1" do
task :build do
run %(docker build . -f docker/3.1/Dockerfile -t convenient_service:3.1)
Expand Down

0 comments on commit e3318a3

Please sign in to comment.