diff --git a/.delivery/project.toml b/.delivery/project.toml deleted file mode 100644 index f31e457..0000000 --- a/.delivery/project.toml +++ /dev/null @@ -1,9 +0,0 @@ -[local_phases] -unit = "rspec spec/" -lint = 'cookstyle --display-cop-names --extra-details' -syntax = "echo syntax checking with foodcritic has been replaced with cookstyle. skipping" -provision = "echo skipping" -deploy = "echo skipping" -smoke = "echo skipping" -functional = "echo skipping" -cleanup = "echo skipping" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a174b60..212a779 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,12 @@ jobs: uses: actions/checkout@v2 - name: Install Chef Workstation uses: actionshub/chef-install@main - - name: Run Chef Delivery - run: chef exec delivery local all + - name: Run Cookstyle + run: chef exec rake cookstyle + env: + CHEF_LICENSE: accept-no-persist + - name: Run Specs + run: chef exec rake spec env: CHEF_LICENSE: accept-no-persist @@ -56,6 +60,7 @@ jobs: - 'authoritative-postgres' - 'recursor-multi' fail-fast: false + continue-on-error: ${{ matrix.os == 'centos-8' }} steps: - name: Checkout Code uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index ffaaa49..9661683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -407,6 +407,4 @@ - \[COOK-2986\] Fix foodcritic warnings [\#7](https://github.com/dnsimple/chef-pdns/pull/7) ([stevendanna](https://github.com/stevendanna)) - \[COOK-2604\] Configure a PowerDNS server [\#2](https://github.com/dnsimple/chef-pdns/pull/2) ([dje](https://github.com/dje)) - - \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/Rakefile b/Rakefile index d305b0b..be384d8 100644 --- a/Rakefile +++ b/Rakefile @@ -2,9 +2,24 @@ task default: %w(test) task test: %w(delivery kitchen) task quick: :delivery -desc 'Run delivery local' +require 'cookstyle' +require 'rubocop/rake_task' +RuboCop::RakeTask.new(:cookstyle) do |task| + task.options = ['--display-cop-names', '--extra-details'] +end + +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new(:spec) do |task| + task.rspec_opts = ['--color', '--format progress'] +end + +desc 'Run linter and specs' task :delivery do - sh 'delivery local all' + g = 'Policyfile.lock.json' + File.delete(g) if File.exist?(g) + + Rake::Task['cookstyle'].invoke + Rake::Task['spec'].invoke end desc 'Run test kitchen with optional KITCHEN_ARGS if that env is present. Defaults suite test to "all" if no KITCHEN_REGEXP env var is present' diff --git a/resources/authoritative_config.rb b/resources/authoritative_config.rb index bf38deb..5eb1eb3 100644 --- a/resources/authoritative_config.rb +++ b/resources/authoritative_config.rb @@ -17,7 +17,8 @@ # limitations under the License. # -provides :pdns_authoritative_config, platform: 'ubuntu' do |node| +provides :pdns_authoritative_config, platform: 'ubuntu' +unified_mode true do |node| node['platform_version'].to_f >= 18.04 end diff --git a/resources/authoritative_install_debian.rb b/resources/authoritative_install_debian.rb index 4cca611..7161569 100644 --- a/resources/authoritative_install_debian.rb +++ b/resources/authoritative_install_debian.rb @@ -17,7 +17,8 @@ # limitations under the License. # -provides :pdns_authoritative_install, platform: 'ubuntu' do |node| +provides :pdns_authoritative_install, platform: 'ubuntu' +unified_mode true do |node| node['platform_version'].to_f >= 18.04 end diff --git a/resources/authoritative_install_rhel.rb b/resources/authoritative_install_rhel.rb index d96574c..1d1ce80 100644 --- a/resources/authoritative_install_rhel.rb +++ b/resources/authoritative_install_rhel.rb @@ -17,7 +17,8 @@ # limitations under the License. # -provides :pdns_authoritative_install, platform_family: 'rhel' do |node| +provides :pdns_authoritative_install, platform_family: 'rhel' +unified_mode true do |node| node['platform_version'].to_i >= 7 end diff --git a/resources/authoritative_service.rb b/resources/authoritative_service.rb index 2939383..2485589 100644 --- a/resources/authoritative_service.rb +++ b/resources/authoritative_service.rb @@ -18,6 +18,7 @@ # provides :pdns_authoritative_service +unified_mode true include Pdns::AuthoritativeHelpers property :instance_name, String, name_property: true, callbacks: { diff --git a/resources/recursor_config.rb b/resources/recursor_config.rb index 684ee6a..2745da6 100644 --- a/resources/recursor_config.rb +++ b/resources/recursor_config.rb @@ -17,7 +17,8 @@ # limitations under the License. # -provides :pdns_recursor_config, platform: 'ubuntu' do |node| +provides :pdns_recursor_config, platform: 'ubuntu' +unified_mode true do |node| node['platform_version'].to_f >= 18.04 end diff --git a/resources/recursor_install_debian.rb b/resources/recursor_install_debian.rb index 6f5fbec..5c70536 100644 --- a/resources/recursor_install_debian.rb +++ b/resources/recursor_install_debian.rb @@ -17,7 +17,8 @@ # limitations under the License. # -provides :pdns_recursor_install, platform: 'ubuntu' do |node| +provides :pdns_recursor_install, platform: 'ubuntu' +unified_mode true do |node| node['platform_version'].to_f >= 18.04 end diff --git a/resources/recursor_install_rhel.rb b/resources/recursor_install_rhel.rb index 7ca91ff..67b6845 100644 --- a/resources/recursor_install_rhel.rb +++ b/resources/recursor_install_rhel.rb @@ -17,7 +17,8 @@ # limitations under the License. # -provides :pdns_recursor_install, platform_family: 'rhel' do |node| +provides :pdns_recursor_install, platform_family: 'rhel' +unified_mode true do |node| node['platform_version'].to_i >= 7 end diff --git a/resources/recursor_service.rb b/resources/recursor_service.rb index 0aae638..98cf7d2 100644 --- a/resources/recursor_service.rb +++ b/resources/recursor_service.rb @@ -18,6 +18,7 @@ # provides :pdns_recursor_service +unified_mode true include Pdns::RecursorHelpers property :instance_name, String, name_property: true, callbacks: {