Skip to content

Commit b00a18c

Browse files
committed
Add quote for "-e" in docker compose command
1 parent 62cae33 commit b00a18c

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

lib/matrixeval/ruby/docker_compose.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def run(arguments)
3232

3333
def env
3434
context.env.map do |k, v|
35-
"-e #{k}=#{v}"
35+
"-e #{k}='#{v}'"
3636
end.join(" ")
3737
end
3838

lib/matrixeval/ruby/runner.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@ def start
3030
GemfileLocks.create
3131
Gitignore.update
3232

33-
context = Context.find_by_command_options!(command.context_options)
33+
if command.all?
34+
Context.all.each do |context|
35+
docker_compose = DockerCompose.new(context)
36+
docker_compose.run(command.rest_arguments)
37+
end
38+
else
39+
context = Context.find_by_command_options!(command.context_options)
3440

35-
docker_compose = DockerCompose.new(context)
36-
docker_compose.run(command.rest_arguments)
41+
docker_compose = DockerCompose.new(context)
42+
docker_compose.run(command.rest_arguments)
43+
end
3744
end
3845
end
3946

test/matrixeval/ruby/docker_compose_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def test_run
4444
expected_docker_compose_command = <<~COMMAND
4545
docker compose -f .matrixeval/docker-compose.yml \
4646
run --rm \
47-
-e RAILS_VERSION=6.0.0 \
48-
-e SIDEKIQ_VERSION=5.0.0 \
47+
-e RAILS_VERSION='6.0.0' \
48+
-e SIDEKIQ_VERSION='5.0.0' \
4949
-v ./.matrixeval/Gemfile.lock.ruby_3_0_rails_6_0_sidekiq_5_0:/app/Gemfile.lock \
5050
ruby_3_0 \
5151
rake test

test/matrixeval/ruby/runner_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def test_start_with_existing_config_file
7575
Matrixeval::Ruby::DockerCompose.any_instance.expects(:system).with(<<~COMMAND
7676
docker compose -f .matrixeval/docker-compose.yml \
7777
run --rm \
78-
-e RAILS_VERSION=6.0.0 \
79-
-e SIDEKIQ_VERSION=5.0.0 \
78+
-e RAILS_VERSION='6.0.0' \
79+
-e SIDEKIQ_VERSION='5.0.0' \
8080
-v ./.matrixeval/Gemfile.lock.ruby_3_0_rails_6_0_sidekiq_5_0:/app/Gemfile.lock \
8181
ruby_3_0 \
8282
rake test

0 commit comments

Comments
 (0)