Upgrade nodejs to the latest version from the repo

This is possible in newer versions of the nodejs cookbook, by setting
the `node["nodejs"]["package_action"]["nodejs"]` attribute to `:upgrade`
This commit is contained in:
Greg Karékinian
2021-03-30 13:58:55 +02:00
parent 9fc49deafe
commit edf2e071e4
18 changed files with 234 additions and 77 deletions

View File

@@ -18,15 +18,18 @@
# limitations under the License.
#
Chef::Recipe.send(:include, NodeJs::Helper)
Chef::DSL::Recipe.include NodeJs::Helper
include_recipe 'build-essential'
build_essential 'install build tools'
case node['platform_family']
when 'rhel', 'fedora', 'amazon'
package %w(openssl-devel tar)
# The ark resource uses and requires python2 for builds
package %w(openssl-devel python2 tar)
when 'debian'
package 'libssl-dev'
package %w(libssl-dev python)
when 'suse'
package %w(python)
end
version = "v#{node['nodejs']['version']}/"
@@ -42,4 +45,5 @@ ark archive_name do
checksum node['nodejs']['source']['checksum']
make_opts ["-j #{node['nodejs']['make_threads']}"]
action :install_with_make
environment(PYTHON: 'python2')
end