8000 Chef 16 compatibility, cookstyle fixes, test update by tas50 · Pull Request #205 · sous-chefs/nodejs · GitHub
[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef 16 compatibility, cookstyle fixes, test update #205

Merged
merged 16 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# https://EditorConfig.org

# top-most EditorConfig file
root=true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# 2 space indentation
indent_style = space
indent_size = 2

# Avoid issues parsing cookbook files later
charset = utf-8

# Avoid cookstyle warnings
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
16 changes: 16 additions & 0 deletions .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: delivery

on: [push, pull_request]

jobs:
delivery:

runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@master
- name: Run Chef Delivery
uses: actionshub/chef-delivery@master
env:
CHEF_LICENSE: accept-no-persist
21 changes: 10 additions & 11 deletions 8000 .gitignore
8000
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
*.rbc
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
Expand All @@ -14,38 +11,40 @@ _Store
*#
.#*
\#*#
.*.sw[a-z]
*.un~
*.tmp
*.bk
*.bkup

# editor temp files
.idea
.*.sw[a-z]

# ruby/bundler files
.ruby-version
.ruby-gemset
.rvmrc
Gemfile.lock
.bundle
*.gem
coverage
spec/reports

# YARD artifacts
# YARD / rdoc artifacts
.yardoc
_yardoc
doc/
.idea
rdoc

# chef stuff
# chef infra stuff
Berksfile.lock
.kitchen
.kitchen.local.yml
kitchen.local.yml
vendor/
.coverage/
.zero-knife.rb
Policyfile.lock.json
Cheffile.lock
.librarian/

# vagrant stuff
.vagrant/
.vagrant.d/
.kitchen/
26 changes: 7 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
sudo: required
dist: trusty

addons:
apt:
sources:
- chef-current-trusty
- chef-current-xenial
packages:
- chefdk
- chef-workstation

# Don't `bundle install` which takes about 1.5 mins
install: echo "skip bundle install"

branches:
Expand All @@ -21,32 +17,24 @@ env:
matrix:
- INSTANCE=package-centos-6
- INSTANCE=package-centos-7
- INSTANCE=package-debian-7
- INSTANCE=package-debian-8
- INSTANCE=package-debian-9
- INSTANCE=package-opensuse-leap
- INSTANCE=package-ubuntu-1404
- INSTANCE=package-ubuntu-1604
- INSTANCE=package-ubuntu-1804
- INSTANCE=package-amazonlinux
- INSTANCE=binary-centos-6
- INSTANCE=binary-centos-7
- INSTANCE=binary-debian-7
- INSTANCE=binary-debian-8
- INSTANCE=binary-debian-9
- INSTANCE=binary-opensuse-leap
- INSTANCE=binary-ubuntu-1404
- INSTANCE=binary-ubuntu-1604
- INSTANCE=binary-ubuntu-1804
- INSTANCE=binary-amazonlinux

before_script:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- eval "$(chef shell-init bash)"
- chef --version
- cookstyle --version
- foodcritic --version

script: KITCHEN_LOCAL_YAML=.kitchen.dokken.yml kitchen verify ${INSTANCE}

matrix:
include:
- script:
- /opt/chefdk/bin/chef exec delivery local all
env: UNIT_AND_LINT=1
script: KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen verify ${INSTANCE}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"chef-software.chef",
"rebornix.ruby",
"editorconfig.editorconfig"
]
}
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This gemfile provides additional gems for testing and releasing this cookbook
# It is meant to be installed on top of ChefDK which provides the majority
# It is meant to be installed on top of Chef Workstation which provide the majority
# of the necessary gems for testing this cookbook
#
# Run 'chef exec bundle install' to install these dependencies
Expand Down
11 changes: 5 additions & 6 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
# limitations under the License.
#

case node['platform_family']
when 'smartos', 'rhel', 'debian', 'fedora', 'mac_os_x', 'suse', 'amazon'
default['nodejs']['install_method'] = 'package'
else
default['nodejs']['install_method'] = 'source'
end
default['nodejs']['install_method'] = if platform_family?('smartos', 'rhel', 'debian', 'fedora', 'mac_os_x', 'suse', 'amazon')
'package'
else
'source'
end

default['nodejs']['version'] = '10.16.3'

Expand Down
6 changes: 3 additions & 3 deletions attributes/packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
include_attribute 'nodejs::repo'

default['nodejs']['packages'] = value_for_platform_family(
'debian' => node['nodejs']['install_repo'] ? ['nodejs'] : ['nodejs', 'npm', 'nodejs-dev'],
%w(rhel fedora amazon) => node['nodejs']['install_repo'] ? ['nodejs', 'nodejs-devel'] : ['nodejs', 'npm', 'nodejs-dev'],
'suse' => node['platform_version'].to_i < 42 ? ['nodejs', 'nodejs-devel'] : ['nodejs4', 'npm4', 'nodejs4-devel'],
'debian' => node['nodejs']['install_repo'] ? ['nodejs'] : %w(nodejs npm nodejs-dev),
%w(rhel fedora amazon) => node['nodejs']['install_repo'] ? %w(nodejs nodejs-devel) : %w(nodejs npm nodejs-dev),
'suse' => node['platform_version'].to_i < 42 ? %w(nodejs nodejs-devel) : %w(nodejs4 npm4 nodejs4-devel),
'mac_os_x' => ['node'],
'freebsd' => %w(node npm),
'default' => ['nodejs']
Expand Down
79 changes: 40 additions & 39 deletions chefignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Put files/directories that should be ignored in this file when uploading
# to a chef-server or supermarket.
# to a Chef Infra Server or Supermarket.
# Lines that start with '# ' are comments.

# OS generated files #
######################
.DS_Store
ehthumbs.db
Icon?
nohup.out
ehthumbs.db
Thumbs.db

# SASS #
Expand All @@ -16,62 +16,64 @@ Thumbs.db

# EDITORS #
###########
\#*
.#*
*~
*.sw[a-z]
.project
.settings
*_flymake
*_flymake.*
*.bak
*.sw[a-z]
*.tmproj
*~
\#*
mkmf.log
REVISION
TAGS*
tmtags
*_flymake.*
*_flymake
*.tmproj
.project
.settings
mkmf.log

## COMPILED ##
##############
a.out
*.o
*.pyc
*.so
*.com
*.class
*.com
*.dll
*.exe
*.o
*.pyc
*.so
*/rdoc/
a.out

# Testing #
###########
.watchr
.circleci/*
.codeclimate.yml
.foodcritic
.kitchen*
.rspec
spec/*
spec/fixtures/*
test/*
features/*
.rubocop.yml
.travis.yml
.watchr
azure-pipelines.yml
examples/*
features/*
Guardfile
kitchen.yml*
Procfile
.kitchen*
.rubocop.yml
spec/*
Rakefile
.travis.yml
.foodcritic
.codeclimate.yml
spec/*
test/*

# SCM #
#######
.git
*/.git
.gitattributes
.gitconfig
.github/*
.gitignore
.gitmodules
.gitconfig
.gitattributes
.svn
*/.bzr/*
*/.git
*/.hg/*
*/.svn/*

Expand All @@ -82,24 +84,23 @@ Berksfile.lock
cookbooks/*
tmp

# Bundler #
###########
vendor/*
Gemfile
Gemfile.lock

# Policyfile #
##############
Policyfile.rb
Policyfile.lock.json

# Cookbooks #
#############
CONTRIBUTING*
CHANGELOG*
CONTRIBUTING*
TESTING*
MAINTAINERS.toml

# Strainer #
############
Colanderfile
Strainerfile
.colander
.strainer
CODE_OF_CONDUCT*

# Vagrant #
###########
Expand Down
Loading
0