Skip to content

Commit

Permalink
chore(docker): use underscore instead of dash and RUBY_ENGINE instead…
Browse files Browse the repository at this point in the history
… of ENGINE
  • Loading branch information
marian13 committed Mar 25, 2024
1 parent 76f2e40 commit 66e4c2e
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .dev/.tmuxinator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ windows:
layout: even-vertical
root: .
panes:
- task docker:bash ENGINE=ruby VERSION=2.7
- task docker:bash ENGINE=ruby VERSION=3.3
- task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=2.7
- task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=3.3
- git status
- api_docs:
layout: even-vertical
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
#
# IMPORTANT: TruffleRuby 22.3 is currently disabled since too many specs are failing due to CRuby uncompatible code.
#
# NOTE: Use `task docker:bash ENGINE=truffleruby VERSION=22.3` and then `task rspec` to reproduce them locally.
# NOTE: Use `task docker:bash RUBY_ENGINE=truffleruby RUBY_VERSION=22.3` and then `task rspec` to reproduce them locally.
#
# TODO: Make ConvenientService TruffleRuby 22.3 compatible.
#
Expand Down
4 changes: 2 additions & 2 deletions BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ The following command (`task docker:build`) works in both cases.
With leading ENV variables.

```bash
ENGINE=ruby VERSION=2.7 task docker:build
RUBY_ENGINE=ruby RUBY_VERSION=2.7 task docker:build
```

With trailing ENV variables.

```bash
task docker:build ENGINE=ruby VERSION=2.7
task docker:build RUBY_ENGINE=ruby RUBY_VERSION=2.7
```

But at the same time`task rspec` works only with leading ENV variables.
Expand Down
60 changes: 30 additions & 30 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,50 +70,50 @@ tasks:

##
# NOTE: Usage examples.
# task docker:bash ENGINE=ruby VERSION=2.7
# task docker:bash ENGINE=ruby VERSION=3.0
# task docker:bash ENGINE=ruby VERSION=3.1
# task docker:bash ENGINE=ruby VERSION=3.2
# task docker:bash ENGINE=ruby VERSION=3.3
# task docker:bash ENGINE=jruby VERSION=9.4
# task docker:bash ENGINE=truffleruby VERSION=22.3
# task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=2.7
# task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=3.0
# task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=3.1
# task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=3.2
# task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=3.3
# task docker:bash RUBY_ENGINE=jruby RUBY_VERSION=9.4
# task docker:bash RUBY_ENGINE=truffleruby RUBY_VERSION=22.3
#
# NOTE: JRuby 9.4 aims CRuby 3.1 compatibility.
# - https://www.jruby.org/download
#
# NOTE: TruffleRuby 22.3 aims CRuby 3.1 compatibility.
# - https://github.com/oracle/truffleruby/blob/master/doc/user/compatibility.md
#
# NOTE: Naming `ENGINE` is inspired by `ruby_engine` gem.
# NOTE: Naming `RUBY_ENGINE` is inspired by `ruby_engine` gem.
# - https://github.com/janlelis/ruby_engine
#
docker:bash:
cmds:
- docker run --rm -it -v $(pwd):/gem convenient_service:{{.ENGINE}}-{{.VERSION}} bash
- docker run --rm -it -v $(pwd):/gem convenient_service:{{.RUBY_ENGINE}}_{{.RUBY_VERSION}} bash
interactive: true
preconditions:
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
requires:
vars: [ENGINE, VERSION]
vars: [RUBY_ENGINE, RUBY_VERSION]

##
# NOTE: Usage examples.
# task docker:build ENGINE=ruby VERSION=2.7
# task docker:build ENGINE=ruby VERSION=3.0
# task docker:build ENGINE=ruby VERSION=3.1
# task docker:build ENGINE=ruby VERSION=3.2
# task docker:build ENGINE=ruby VERSION=3.3
# task docker:build ENGINE=jruby VERSION=9.4
# task docker:build ENGINE=truffleruby VERSION=22.3
# task docker:build RUBY_ENGINE=ruby RUBY_VERSION=2.7
# task docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.0
# task docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.1
# task docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.2
# task docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.3
# task docker:build RUBY_ENGINE=jruby RUBY_VERSION=9.4
# task docker:build RUBY_ENGINE=truffleruby RUBY_VERSION=22.3
#
# NOTE: JRuby 9.4 aims CRuby 3.1 compatibility.
# - https://www.jruby.org/download
#
# NOTE: TruffleRuby 22.3 aims CRuby 3.1 compatibility.
# - https://github.com/oracle/truffleruby/blob/master/doc/user/compatibility.md
#
# NOTE: Naming `ENGINE` is inspired by `ruby_engine` gem.
# NOTE: Naming `RUBY_ENGINE` is inspired by `ruby_engine` gem.
# - https://github.com/janlelis/ruby_engine
#
# NOTE: Meaning of `|| 2> /dev/null`.
Expand All @@ -124,25 +124,25 @@ tasks:
#
docker:build:
cmds:
- rm Gemfile.{{.ENGINE}}-{{.VERSION}} 2> /dev/null || true
- rm Gemfile.{{.ENGINE}}-{{.VERSION}}.lock 2> /dev/null || true
- cp Gemfile Gemfile.{{.ENGINE}}-{{.VERSION}}
- docker build . -f docker/{{.ENGINE}}-{{.VERSION}}/Dockerfile -t convenient_service:{{.ENGINE}}-{{.VERSION}}
- rm Gemfile.{{.RUBY_ENGINE}}_{{.RUBY_VERSION}} 2> /dev/null || true
- rm Gemfile.{{.RUBY_ENGINE}}_{{.RUBY_VERSION}}.lock 2> /dev/null || true
- cp Gemfile Gemfile.{{.RUBY_ENGINE}}_{{.RUBY_VERSION}}
- docker build . -f docker/{{.RUBY_ENGINE}}_{{.RUBY_VERSION}}/Dockerfile -t convenient_service:{{.RUBY_ENGINE}}_{{.RUBY_VERSION}}
preconditions:
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
requires:
vars: [ENGINE, VERSION]
vars: [RUBY_ENGINE, RUBY_VERSION]

docker:build:all:
cmds:
- task: docker:build ENGINE=ruby VERSION=2.7
- task: docker:build ENGINE=ruby VERSION=3.0
- task: docker:build ENGINE=ruby VERSION=3.1
- task: docker:build ENGINE=ruby VERSION=3.2
- task: docker:build ENGINE=ruby VERSION=3.3
- task: docker:build ENGINE=jruby VERSION=9.4
- task: docker:build ENGINE=truffleruby VERSION=22.3
- task: docker:build RUBY_ENGINE=ruby RUBY_VERSION=2.7
- task: docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.0
- task: docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.1
- task: docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.2
- task: docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.3
- task: docker:build RUBY_ENGINE=jruby RUBY_VERSION=9.4
- task: docker:build RUBY_ENGINE=truffleruby RUBY_VERSION=22.3
preconditions:
- sh: '[ "${IN_DOCKER_CONTAINER}" != "true" ]'
msg: This task can be invoked only from the host operating system (https://www.ibm.com/cloud/learn/containerization)
Expand Down
4 changes: 2 additions & 2 deletions docker/jruby-9.4/Dockerfile → docker/jruby_9.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
# cd convenient_service
# cp Gemfile Gemfile.jruby-9.4
# docker build . -f docker/jruby-9.4/Dockerfile -t convenient_service:jruby-9.4
# # or `task docker:build ENGINE=jruby VERSION=9.4`
# # or `task docker:build ENGINE=jruby RUBY_VERSION=9.4`
#
# NOTE: A command to run bash in container.
#
# cd convenient_service
# docker run --rm -it -v $(pwd):/gem convenient_service:jruby-9.4 bash
# # or `task docker:bash ENGINE=jruby VERSION=9.4`
# # or `task docker:bash RUBY_ENGINE=jruby RUBY_VERSION=9.4`
#
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
Expand Down
4 changes: 2 additions & 2 deletions docker/ruby-2.7/Dockerfile → docker/ruby_2.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# cd convenient_service
# cp Gemfile Gemfile.ruby-2.7
# docker build . -f docker/ruby-2.7/Dockerfile -t convenient_service:ruby-2.7
# # or `task docker:build ENGINE=ruby VERSION=2.7`
# # or `task docker:build RUBY_ENGINE=ruby RUBY_VERSION=2.7`
#
# NOTE: A command to run bash in container.
#
# cd convenient_service
# docker run --rm -it -v $(pwd):/gem convenient_service:ruby-2.7 bash
# # or `task docker:bash ENGINE=ruby VERSION=2.7`
# # or `task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=2.7`
#
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
Expand Down
4 changes: 2 additions & 2 deletions docker/ruby-3.0/Dockerfile → docker/ruby_3.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# cd convenient_service
# cp Gemfile Gemfile.ruby-3.0
# docker build . -f docker/ruby-3.0/Dockerfile -t convenient_service:ruby-3.0
# # or `task docker:build ENGINE=ruby VERSION=3.0`
# # or `task docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.0`
#
# NOTE: A command to run bash in container.
#
# cd convenient_service
# docker run --rm -it -v $(pwd):/gem convenient_service:ruby-3.0 bash
# # or `task docker:bash ENGINE=ruby VERSION=3.0`
# # or `task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=3.0`
#
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
Expand Down
4 changes: 2 additions & 2 deletions docker/ruby-3.1/Dockerfile → docker/ruby_3.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# cd convenient_service
# cp Gemfile Gemfile.ruby-3.1
# docker build . -f docker/ruby-3.1/Dockerfile -t convenient_service:ruby-3.1
# # or `task docker:build ENGINE=ruby VERSION=3.1`
# # or `task docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.1`
#
# NOTE: A command to run bash in container.
#
# cd convenient_service
# docker run --rm -it -v $(pwd):/gem convenient_service:ruby-3.1 bash
# # or `task docker:bash ENGINE=ruby VERSION=3.1`
# # or `task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=3.1`
#
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
Expand Down
4 changes: 2 additions & 2 deletions docker/ruby-3.2/Dockerfile → docker/ruby_3.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# cd convenient_service
# cp Gemfile Gemfile.ruby-3.2
# docker build . -f docker/ruby-3.2/Dockerfile -t convenient_service:ruby-3.2
# # or `task docker:build ENGINE=ruby VERSION=3.2`
# # or `task docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.2`
#
# NOTE: A command to run bash in container.
#
# cd convenient_service
# docker run --rm -it -v $(pwd):/gem convenient_service:ruby-3.2 bash
# # or `task docker:bash ENGINE=ruby VERSION=3.2`
# # or `task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=3.2`
#
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
Expand Down
4 changes: 2 additions & 2 deletions docker/ruby-3.3/Dockerfile → docker/ruby_3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# cd convenient_service
# cp Gemfile Gemfile.ruby-3.3
# docker build . -f docker/ruby-3.3/Dockerfile -t convenient_service:ruby-3.3
# # or `task docker:build ENGINE=ruby VERSION=3.3`
# # or `task docker:build RUBY_ENGINE=ruby RUBY_VERSION=3.3`
#
# NOTE: A command to run bash in container.
#
# cd convenient_service
# docker run --rm -it -v $(pwd):/gem convenient_service:ruby-3.3 bash
# # or `task docker:bash ENGINE=ruby VERSION=3.3`
# # or `task docker:bash RUBY_ENGINE=ruby RUBY_VERSION=3.3`
#
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# cd convenient_service
# cp Gemfile Gemfile.truffleruby-22.3
# docker build . -f docker/truffleruby-22.3/Dockerfile -t convenient_service:truffleruby-22.3
# # or `task docker:build ENGINE=truffleruby VERSION=22.3`
# # or `task docker:build ENGINE=truffleruby RUBY_VERSION=22.3`
#
# NOTE: A command to run bash in container.
#
# cd convenient_service
# docker run --rm -it -v $(pwd):/gem convenient_service:truffleruby-22.3 bash
# # or `task docker:bash ENGINE=jruby VERSION=9.4`
# # or `task docker:bash RUBY_ENGINE=jruby RUBY_VERSION=9.4`
#
# NOTE: If there are no memory, performance, or cost constraints, prefer to use as standard Linux distribution as it is possible.
# In a general case, you simply won't have enough time to resolve all the "quirks" of more specific distributions if you are an application developer.
Expand Down

0 comments on commit 66e4c2e

Please sign in to comment.