diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ca1440a..06a7599 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,6 @@ jobs: fail-fast: false matrix: include: - - ruby: 2.5.8 - gemfile: Gemfile.2.5 - ruby: 3.2.0 gemfile: Gemfile - ruby: 3.4.1 diff --git a/.ruby-version b/.ruby-version index 47b322c..7921bd0 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.1 +3.4.8 diff --git a/CHANGELOG.md b/CHANGELOG.md index e820601..2c5351d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented here. Rascal follows semantic versioning. This has little consequence pre 1.0, so expect breaking changes. +## 0.3.9 (2026-06-19) + +- Support variables within service definitions. +- Drop support for Ruby < 3. + + ## 0.3.8 (2025-02-10) - Ruby 3.4 support. diff --git a/Gemfile.2.5 b/Gemfile.2.5 deleted file mode 120000 index cb0f0b7..0000000 --- a/Gemfile.2.5 +++ /dev/null @@ -1 +0,0 @@ -Gemfile.common \ No newline at end of file diff --git a/Gemfile.2.5.lock b/Gemfile.2.5.lock deleted file mode 100644 index 9242fe7..0000000 --- a/Gemfile.2.5.lock +++ /dev/null @@ -1,125 +0,0 @@ -PATH - remote: . - specs: - rascal (0.3.8) - thor (>= 1.0.0) - -GEM - remote: https://rubygems.org/ - specs: - aruba (0.14.14) - childprocess (>= 0.6.3, < 4.0.0) - contracts (~> 0.9) - cucumber (>= 1.3.19) - ffi (~> 1.9) - rspec-expectations (>= 2.99) - thor (>= 0.19, < 2.0) - builder (3.2.4) - childprocess (1.0.0) - coderay (1.1.2) - contracts (0.16.0) - cucumber (7.1.0) - builder (~> 3.2, >= 3.2.4) - cucumber-core (~> 10.1, >= 10.1.0) - cucumber-create-meta (~> 6.0, >= 6.0.1) - cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) - cucumber-gherkin (~> 22.0, >= 22.0.0) - cucumber-html-formatter (~> 17.0, >= 17.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-wire (~> 6.2, >= 6.2.0) - diff-lcs (~> 1.4, >= 1.4.4) - mime-types (~> 3.3, >= 3.3.1) - multi_test (~> 0.1, >= 0.1.2) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-core (10.1.1) - cucumber-gherkin (~> 22.0, >= 22.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-tag-expressions (~> 4.1, >= 4.1.0) - cucumber-create-meta (6.0.4) - cucumber-messages (~> 17.1, >= 17.1.1) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-cucumber-expressions (14.0.0) - cucumber-gherkin (22.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-html-formatter (17.0.0) - cucumber-messages (~> 17.1, >= 17.1.0) - cucumber-messages (17.1.1) - cucumber-tag-expressions (4.1.0) - cucumber-wire (6.2.1) - cucumber-core (~> 10.1, >= 10.1.0) - cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) - diff-lcs (1.5.0) - ffi (1.10.0) - formatador (0.2.5) - guard (2.17.0) - formatador (>= 0.2.4) - listen (>= 2.7, < 4.0) - lumberjack (>= 1.0.12, < 2.0) - nenv (~> 0.1) - notiffany (~> 0.0) - pry (>= 0.9.12) - shellany (~> 0.0) - thor (>= 0.18.1) - guard-compat (1.2.1) - guard-cucumber (1.5.4) - cucumber (>= 1.3.0) - guard-compat (~> 1.0) - nenv (~> 0.1) - guard-rspec (4.7.3) - guard (~> 2.1) - guard-compat (~> 1.1) - rspec (>= 2.99.0, < 4.0) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - lumberjack (1.0.13) - method_source (0.9.2) - mime-types (3.4.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - multi_test (0.1.2) - nenv (0.3.0) - notiffany (0.1.1) - nenv (~> 0.1) - shellany (~> 0.0) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - rake (13.0.1) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) - ffi (~> 1.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - ruby_dep (1.5.0) - shellany (0.0.1) - sys-uname (1.2.2) - ffi (~> 1.1) - thor (1.2.2) - -PLATFORMS - ruby - -DEPENDENCIES - aruba - cucumber - guard-cucumber - guard-rspec - rake (~> 13.0) - rascal! - rspec - -BUNDLED WITH - 2.3.27 diff --git a/Gemfile.lock b/Gemfile.lock index f3e113a..5c157a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rascal (0.3.8) + rascal (0.3.9) thor (>= 1.0.0) GEM diff --git a/lib/rascal/environments_definition/gitlab.rb b/lib/rascal/environments_definition/gitlab.rb index 00795db..a7969d5 100644 --- a/lib/rascal/environments_definition/gitlab.rb +++ b/lib/rascal/environments_definition/gitlab.rb @@ -122,7 +122,7 @@ def build_services(name, services, volumes: [], env_variables: {}) alias_name: service_config['alias'], image: service_config['name'], volumes: volumes, - env_variables: env_variables, + env_variables: env_variables.merge(service_config.fetch('variables', {})), command: service_config['command'], ) end @@ -144,4 +144,3 @@ def build_volumes(name, volume_config) end end end - diff --git a/lib/rascal/version.rb b/lib/rascal/version.rb index 2d3d963..8a15da5 100644 --- a/lib/rascal/version.rb +++ b/lib/rascal/version.rb @@ -1,3 +1,3 @@ module Rascal - VERSION = "0.3.8" + VERSION = "0.3.9" end diff --git a/spec/rascal/environments_definition/gitlab_spec.rb b/spec/rascal/environments_definition/gitlab_spec.rb index 7d1ed52..004e0a5 100644 --- a/spec/rascal/environments_definition/gitlab_spec.rb +++ b/spec/rascal/environments_definition/gitlab_spec.rb @@ -54,6 +54,29 @@ def from_config(yaml, name) ) end + it 'sets env variables for services' do + environment = from_config(<<~YAML, 'job') + job: + image: job-1-image:latest + variables: + FOO: foo + BAR: bar + services: + - name: service-1-image + alias: service-1 + command: bin/start + variables: + FOO: overridden foo + BAZ: baz + YAML + + expect(environment.services.first.env_variables).to eq( + 'FOO' => 'overridden foo', + 'BAR' => 'bar', + 'BAZ' => 'baz', + ) + end + it 'adds a build and repo volume by default' do environment = from_config(<<~YAML, 'job') job: