Skip to content

Commit

Permalink
Swap images
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Jul 8, 2024
1 parent bae1acf commit e431c86
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 40 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ jobs:
image: "ghcr.io/datadog/images-rb/engines/${{ matrix.engine.name }}:${{ matrix.engine.version }}"
steps:
- uses: actions/checkout@v4
- name: Bundle install
run: bundle install
- name: Ruby version
run: ruby -v
- name: Gem version
run: gem -v
- name: Bundler version
run: bundler -v
- name: Install dependencies
run: bundler install
- name: Run the test
run: bundle exec rake test spec

Expand Down
34 changes: 10 additions & 24 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
jruby-9.2:
build:
context: "."
dockerfile: images/jruby-9.2.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/jruby:9.2
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/jruby-9.2.gemfile
Expand All @@ -18,7 +18,7 @@ services:
jruby-9.3:
build:
context: "."
dockerfile: images/jruby-9.3.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/jruby:9.3
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/jruby-9.3.gemfile
Expand All @@ -31,7 +31,7 @@ services:
jruby-9.4:
build:
context: "."
dockerfile: images/jruby-9.4.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/jruby:9.4
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/jruby-9.4.gemfile
Expand All @@ -44,7 +44,7 @@ services:
ruby-2.5:
build:
context: "."
dockerfile: images/ruby-2.5.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/ruby:2.5
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/ruby-2.5.gemfile
Expand All @@ -57,7 +57,7 @@ services:
ruby-2.6:
build:
context: "."
dockerfile: images/ruby-2.6.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/ruby:2.6
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/ruby-2.6.gemfile
Expand All @@ -70,7 +70,7 @@ services:
ruby-2.7:
build:
context: "."
dockerfile: images/ruby-2.7.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/ruby:2.7
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/ruby-2.7.gemfile
Expand All @@ -83,7 +83,7 @@ services:
ruby-3.0:
build:
context: "."
dockerfile: images/ruby-3.0.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/ruby:3.0
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/ruby-3.0.gemfile
Expand All @@ -96,7 +96,7 @@ services:
ruby-3.1:
build:
context: "."
dockerfile: images/ruby-3.1.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/ruby:3.1
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/ruby-3.1.gemfile
Expand All @@ -109,7 +109,7 @@ services:
ruby-3.2:
build:
context: "."
dockerfile: images/ruby-3.2.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/ruby:3.2
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/ruby-3.2.gemfile
Expand All @@ -122,7 +122,7 @@ services:
ruby-3.3:
build:
context: "."
dockerfile: images/ruby-3.3.dockerfile
dockerfile: ghcr.io/datadog/images-rb/engines/ruby:3.3
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/ruby-3.3.gemfile
Expand All @@ -132,19 +132,6 @@ services:
- ".:/app"
- bundle-ruby-3.3:/usr/local/bundle
working_dir: "/app"
ruby-3.4:
build:
context: "."
dockerfile: images/ruby-3.4.dockerfile
command: "/bin/bash"
environment:
BUNDLE_GEMFILE: gemfiles/ruby-3.4.gemfile
stdin_open: true
tty: true
volumes:
- ".:/app"
- bundle-ruby-3.4:/usr/local/bundle
working_dir: "/app"
volumes:
bundle-jruby-9.2:
bundle-jruby-9.3:
Expand All @@ -156,4 +143,3 @@ volumes:
bundle-ruby-3.1:
bundle-ruby-3.2:
bundle-ruby-3.3:
bundle-ruby-3.4:
1 change: 0 additions & 1 deletion images/jruby-9.2.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/jruby-9.3.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/jruby-9.4.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/ruby-2.5.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/ruby-2.6.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/ruby-2.7.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/ruby-3.0.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/ruby-3.1.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/ruby-3.2.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/ruby-3.3.dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion images/ruby-3.4.dockerfile

This file was deleted.

17 changes: 14 additions & 3 deletions tasks/docker/compose.rake
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,26 @@ namespace :docker do
require "psych"
require "open3"

images = Dir.glob(File.join("images", "**", "*.dockerfile"))
images = [
"jruby:9.2",
"jruby:9.3",
"jruby:9.4",
"ruby:2.5",
"ruby:2.6",
"ruby:2.7",
"ruby:3.0",
"ruby:3.1",
"ruby:3.2",
"ruby:3.3"
]

docker_compose = images.each_with_object({"services" => {}, "volumes" => {}}) do |image, compose|
ruby = File.basename(image, ".dockerfile")
ruby = image.sub(":", "-")

compose["services"][ruby] = {
"build" => {
"context" => ".",
"dockerfile" => image
"dockerfile" => "ghcr.io/datadog/images-rb/engines/#{image}"
},
"command" => "/bin/bash",
"environment" => {
Expand Down

0 comments on commit e431c86

Please sign in to comment.