From 36074639e48a802d0b82033d44f63e9972711621 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 19 Nov 2024 10:46:16 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=AB=B7=F0=9F=A4=AF=F0=9F=AB=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dan Webb --- .rubocop.yml | 2 ++ CHANGELOG.md | 2 ++ attributes/default.rb | 4 ++-- attributes/repo.rb | 6 ++--- kitchen.yml | 43 ----------------------------------- recipes/nodejs_from_source.rb | 17 +++++++++++--- 6 files changed, 23 insertions(+), 51 deletions(-) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..6188300 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,2 @@ +require: + - cookstyle diff --git a/CHANGELOG.md b/CHANGELOG.md index 8840705..6a777a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Update default version to current LTS + ## 10.1.21 - *2024-11-19* - Update CI platforms diff --git a/attributes/default.rb b/attributes/default.rb index 5ea85ca..e766335 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -26,13 +26,13 @@ 'source' end -default['nodejs']['version'] = '17.9.0' +default['nodejs']['version'] = '22.11.0' default['nodejs']['prefix_url']['node'] = 'https://nodejs.org/dist/' default['nodejs']['tmpdir'] = '/tmp' default['nodejs']['source']['url'] = nil # Auto generated -default['nodejs']['source']['checksum'] = '25d8c6559456d548823e3f7f4fae7dc8c7d5a0f7772c79c8d902528e801ba09a' +default['nodejs']['source']['checksum'] = '24e5130fa7bc1eaab218a0c9cb05e03168fa381bb9e3babddc6a11f655799222' default['nodejs']['binary']['url'] = nil # Auto generated default['nodejs']['binary']['checksum']['linux_x64'] = '8c9f4c95c254336fcb2c768e746f4316b8176adc0fb599cbbb460d0933991d12' diff --git a/attributes/repo.rb b/attributes/repo.rb index c46202b..b4cc4f8 100644 --- a/attributes/repo.rb +++ b/attributes/repo.rb @@ -1,16 +1,16 @@ case node['platform_family'] when 'debian' default['nodejs']['install_repo'] = true - default['nodejs']['repo'] = 'https://deb.nodesource.com/node_17.x' + default['nodejs']['repo'] = 'https://deb.nodesource.com/node_20.x' default['nodejs']['keyserver'] = 'keyserver.ubuntu.com' default['nodejs']['key'] = '1655a0ab68576280' when 'rhel', 'amazon' default['nodejs']['install_repo'] = true release_ver = platform?('amazon') ? 7 : node['platform_version'].to_i - default['nodejs']['repo'] = "https://rpm.nodesource.com/pub_17.x/el/#{release_ver}/$basearch" + default['nodejs']['repo'] = "https://rpm.nodesource.com/pub_20.x/el/#{release_ver}/$basearch" default['nodejs']['key'] = 'https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL' when 'fedora' default['nodejs']['install_repo'] = true - default['nodejs']['repo'] = 'https://rpm.nodesource.com/pub_17.x/el/9/$basearch' + default['nodejs']['repo'] = 'https://rpm.nodesource.com/pub_20.x/el/9/$basearch' default['nodejs']['key'] = 'https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL' end diff --git a/kitchen.yml b/kitchen.yml index 7e92a87..6f09eba 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -2,36 +2,8 @@ driver: name: vagrant -provisioner: - name: chef_zero - deprecations_as_errors: true - chef_license: accept-no-persist - -verifier: - name: inspec - -platforms: - - name: almalinux-8 - - name: amazonlinux-2 - - name: centos-7 - - name: centos-stream-8 - - name: debian-10 - - name: debian-11 - - name: opensuse-leap-15 - - name: rockylinux-8 - - name: ubuntu-18.04 - - name: ubuntu-20.04 - - name: windows-2016 - driver: - gui: false - box: tas50/windows_2016 - customize: - memory: 2048 - suites: - name: default - excludes: - - windows-2016 run_list: - recipe[nodejs::default] attributes: @@ -46,8 +18,6 @@ suites: - name: express action: :uninstall - name: npm_embedded - excludes: - - windows-2016 run_list: - recipe[nodejs::npm] attributes: @@ -55,8 +25,6 @@ suites: npm: install_method: embedded - name: npm_source - excludes: - - windows-2016 run_list: - recipe[nodejs::npm] attributes: @@ -64,18 +32,12 @@ suites: npm: install_method: source - name: package - excludes: - - windows-2016 run_list: - recipe[test::default] - name: source - excludes: - - windows-2016 run_list: - recipe[test::source] - name: options - includes: - - ubuntu-20.04 run_list: - recipe[nodejs] attributes: @@ -88,8 +50,3 @@ suites: acpid: "--force-yes" package_action: adcli: :nothing - - name: chocolatey - includes: - - windows-2016 - run_list: - - recipe[test::chocolatey] diff --git a/recipes/nodejs_from_source.rb b/recipes/nodejs_from_source.rb index 1e21927..8bb1033 100644 --- a/recipes/nodejs_from_source.rb +++ b/recipes/nodejs_from_source.rb @@ -22,13 +22,24 @@ build_essential 'install build tools' -case node['platform_family'] +case node['platform'] when 'rhel', 'fedora', 'amazon' # The ark resource uses and requires python2 for builds package %w(openssl-devel python3 tar) +# debian-12 & ubuntu 2204 need python 3 when 'debian' - package %w(libssl-dev python) -when 'suse' + if node['platform_version'].to_i >= 12 + package %w(libssl-dev python3) + else + package %w(libssl-dev python) + end +when 'ubuntu' + if node['platform_version'].to_f >= 22.04 + package %w(libssl-dev python3) + else + package %w(libssl-dev python) + end +else package %w(python) end