From 41f8a17bd6630cd5e71916493b220ec048c6a8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fa=C3=BAndez?= Date: Sun, 29 Jun 2025 23:34:25 -0400 Subject: [PATCH 1/3] Update CI platforms and node build dependencies Updated CI and Test Kitchen configurations to use newer OS versions (e.g., amazonlinux-2023, centos-stream-10, debian-12, fedora-40, oraclelinux-9, ubuntu-24.04). Added 'tar' as a dependency for Amazon in node_build.rb and updated Python version logic. Changed test node version in standalone_install_spec.rb to 24.3.0. --- .github/workflows/ci.yml | 22 +++++----- kitchen.dokken.yml | 40 ++++++++++++++++--- libraries/chef/node_build.rb | 12 +++--- .../default/standalone_install_spec.rb | 2 +- 4 files changed, 52 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 348107a..bec9e27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,21 +14,19 @@ jobs: strategy: matrix: os: - - amazonlinux-2 - - centos-8 - - debian-11 - - fedora-34 - - oraclelinux-8 - - ubuntu-2004 - - ubuntu-2204 + - amazonlinux-2023 + - centos-stream-10 + - debian-12 + - fedora-40 + - oraclelinux-9 + - ubuntu-2404 workstation_version: - - '21.3.346' - - '21.11.679' - suite: [default] + - '24.12.1073' + - '25.5.1084' fail-fast: false steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Chef uses: actionshub/chef-install@main with: @@ -40,7 +38,7 @@ jobs: - name: Test-Kitchen uses: actionshub/test-kitchen@main with: - suite: ${{ matrix.suite }} + suite: default os: ${{ matrix.os }} env: KITCHEN_LOCAL_YAML: kitchen.dokken.yml diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 941c5ed..3cf8933 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -17,13 +17,17 @@ verifier: chef_license: accept-no-persist platforms: - - name: amazonlinux-2 + - name: amazonlinux-2023 driver: - image: dokken/amazonlinux-2 + image: dokken/amazonlinux-2023 pid_one_command: /usr/lib/systemd/systemd - - name: centos-8 + - name: centos-stream-9 driver: - image: dokken/centos-8 + image: dokken/centos-stream-9 + pid_one_command: /usr/lib/systemd/systemd + - name: centos-stream-10 + driver: + image: dokken/centos-stream-10 pid_one_command: /usr/lib/systemd/systemd - name: debian-11 driver: @@ -31,14 +35,32 @@ platforms: pid_one_command: /bin/systemd intermediate_instructions: - RUN /usr/bin/apt-get update -qq - - name: fedora-34 + - name: debian-12 + driver: + image: dokken/debian-12 + pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update -qq + - name: fedora-40 + driver: + image: dokken/fedora-40 + pid_one_command: /usr/lib/systemd/systemd + - name: fedora-41 driver: - image: dokken/fedora-34 + image: dokken/fedora-41 + pid_one_command: /usr/lib/systemd/systemd + - name: fedora-42 + driver: + image: dokken/fedora-42 pid_one_command: /usr/lib/systemd/systemd - name: oraclelinux-8 driver: image: dokken/oraclelinux-8 pid_one_command: /usr/lib/systemd/systemd + - name: oraclelinux-9 + driver: + image: dokken/oraclelinux-9 + pid_one_command: /usr/lib/systemd/systemd - name: ubuntu-20.04 driver: image: dokken/ubuntu-20.04 @@ -51,6 +73,12 @@ platforms: pid_one_command: /bin/systemd intermediate_instructions: - RUN /usr/bin/apt-get update -qq + - name: ubuntu-24.04 + driver: + image: dokken/ubuntu-24.04 + pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update -qq suites: - name: default diff --git a/libraries/chef/node_build.rb b/libraries/chef/node_build.rb index c6b149d..a50bd8c 100644 --- a/libraries/chef/node_build.rb +++ b/libraries/chef/node_build.rb @@ -1,15 +1,13 @@ class Chef module NodeBuild def node_build_dependencies - [python, gcc, make].compact + [tar, python, gcc, make].compact end def python version = node['platform_version'].to_i - if platform?('centos') && version >= 8 then 'python3' - elsif platform?('oracle') && version >= 8 then 'python36' - elsif platform?('ubuntu') && version >= 20 then 'python3' - elsif platform?(*supported_plaftorms) then 'python' + if platform?('oracle') && version == 8 then 'python36' + elsif platform?(*supported_plaftorms) then 'python3' end end @@ -24,6 +22,10 @@ def make 'make' if platform?(*supported_plaftorms) end + def tar + 'tar' if platform?('amazon') + end + def supported_plaftorms %w(amazon centos debian fedora oracle ubuntu) end diff --git a/test/integration/default/standalone_install_spec.rb b/test/integration/default/standalone_install_spec.rb index ca2cf22..f4f18ec 100644 --- a/test/integration/default/standalone_install_spec.rb +++ b/test/integration/default/standalone_install_spec.rb @@ -29,7 +29,7 @@ control 'build a node version with a node-build binary' do node_versions_home = '/tmp/node-build-versions' - node_version = '12.16.1' + node_version = '24.3.0' node_home = ::File.join node_versions_home, node_version describe command("#{node_build_bin} #{node_version} #{node_home}") do From dd51427b1afe5731b62472f312ea79a60e022cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fa=C3=BAndez?= Date: Mon, 30 Jun 2025 00:06:16 -0400 Subject: [PATCH 2/3] Update testing instructions and fix platform method typos Replaces deprecated lint and unit test commands in TESTING.md with updated alternatives. In node_build.rb, corrects 'supported_plaftorms' to 'supported_platforms', updates python selection logic for Debian, Ubuntu, and Oracle, and adjusts method calls to use the corrected platform method. --- TESTING.md | 4 ++-- libraries/chef/node_build.rb | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/TESTING.md b/TESTING.md index c3fb28f..717e0c9 100644 --- a/TESTING.md +++ b/TESTING.md @@ -13,13 +13,13 @@ berks install --except integration ### Lint and Style ```sh -CHEF_LICENSE=accept-no-persist delivery local lint +cookstyle --display-cop-names --extra-details ``` ### Unit specs ```sh -CHEF_LICENSE=accept-no-persist delivery local unit +CHEF_LICENSE=accept-no-persist chef exec rspec ``` ## Integration tests diff --git a/libraries/chef/node_build.rb b/libraries/chef/node_build.rb index a50bd8c..55fde6b 100644 --- a/libraries/chef/node_build.rb +++ b/libraries/chef/node_build.rb @@ -6,8 +6,10 @@ def node_build_dependencies def python version = node['platform_version'].to_i - if platform?('oracle') && version == 8 then 'python36' - elsif platform?(*supported_plaftorms) then 'python3' + if platform?('debian', 'ubuntu') then 'python3' + elsif platform?('oracle') && version == 8 then 'python36' + elsif platform?('oracle') && version == 9 then 'python3' + elsif platform?(*supported_platforms) then 'python' end end @@ -19,14 +21,14 @@ def gcc end def make - 'make' if platform?(*supported_plaftorms) + 'make' if platform?(*supported_platforms) end def tar 'tar' if platform?('amazon') end - def supported_plaftorms + def supported_platforms %w(amazon centos debian fedora oracle ubuntu) end end From 84fb907ee8b5b2805c87cc4fececef5efb3e96f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fa=C3=BAndez?= Date: Mon, 30 Jun 2025 00:08:00 -0400 Subject: [PATCH 3/3] Update README.md (skip ci) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index afacb3b..38d1d56 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Chef cookbook for node-build. ## Cookbook ```ruby -cookbook 'node_build', '~> 1.0.3' +cookbook 'node_build', '~> 1.0.4' ``` ## Resource