diff --git a/.delivery/project.toml b/.delivery/project.toml index 6d5e361..e703549 100644 --- a/.delivery/project.toml +++ b/.delivery/project.toml @@ -1 +1,9 @@ -remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml" +[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" \ No newline at end of file diff --git a/.github/workflows/delivery.yml b/.github/workflows/delivery.yml index 4b5c467..d03b70f 100644 --- a/.github/workflows/delivery.yml +++ b/.github/workflows/delivery.yml @@ -9,8 +9,8 @@ jobs: steps: - name: Check out code - uses: actions/checkout@master + uses: actions/checkout@main - name: Run Chef Delivery - uses: actionshub/chef-delivery@master + uses: actionshub/chef-delivery@main env: CHEF_LICENSE: accept-no-persist \ No newline at end of file diff --git a/providers/default.rb b/providers/default.rb index 0146c89..9ced1bf 100644 --- a/providers/default.rb +++ b/providers/default.rb @@ -183,6 +183,10 @@ def eval_post_install_action end def run_post_install_action + # In solaris moving /etc/chef.upgrade to /etc/chef + if platform_family?('solaris2') + move_opt_chef(etc_chef_upgrade, etc_chef) + end # make sure the passed action will actually work eval_post_install_action @@ -230,6 +234,14 @@ def chef_upgrade_log "#{chef_install_dir}_upgrade.log" end +def etc_chef + '/etc/chef' +end + +def etc_chef_upgrade + "#{etc_chef}.upgrade" +end + # cleanup cruft from *prior* runs def cleanup if ::File.exist?(chef_backup_dir) @@ -645,7 +657,14 @@ def license_acceptance! # we have to get the script from mixlib-install.. install_script = mixlib_install.install_command # ...before we blow mixlib-install away - platform_family?('windows') ? prepare_windows : move_opt_chef(chef_install_dir, chef_backup_dir) + if platform_family?('windows') + prepare_windows + elsif platform_family?('solaris2') + copy_opt_chef(chef_install_dir, chef_backup_dir) + move_opt_chef(etc_chef, etc_chef_upgrade) + else + move_opt_chef(chef_install_dir, chef_backup_dir) + end execute_install_script(install_script) end @@ -683,6 +702,10 @@ def license_acceptance! if ::File.exist?(chef_backup_dir) Chef::Log.warn "CHEF INFRA CLIENT UPGRADE ABORTED due to #{e}: rolling back to #{chef_backup_dir} copy" move_opt_chef(chef_backup_dir, chef_install_dir) unless platform_family?('windows') + # rolling back etc\chef in solaris + if platform_family?('solaris2') + move_opt_chef(etc_chef_upgrade, etc_chef) + end else Chef::Log.warn "NO #{chef_backup_dir} DIR TO ROLL BACK TO!" end