summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <jmccrae@chf.io>2022-05-05 11:24:10 +0600
committerJohn McCrae <jmccrae@chf.io>2022-05-05 11:24:10 +0600
commitbc7a9f24b462b6f3973d0317191c9e92ea69229a (patch)
tree24db88db2761934107c4d1acff489434e390a095
parentec9e910489e5e3e69a1e93ebd983e61f54232e71 (diff)
downloadchef-bc7a9f24b462b6f3973d0317191c9e92ea69229a.tar.gz
Updated the recipe to remove Git completely before updating it.
Signed-off-by: John McCrae <jmccrae@chf.io>
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/macos.rb19
1 files changed, 13 insertions, 6 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
index 5b6818367a..1237950353 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
@@ -66,16 +66,23 @@ chef_client_launchd "Every 30 mins Infra Client run" do
action :enable
end
-execute "find the user" do
- command "whoami"
- live_stream true
- action :run
+user "tempadmin" do
+ gid 80
+ shell "/bin/zsh"
+ password "password"
end
# We're overcoming a problem where Homebrew updating Git on MacOS throws a symlink error
# We remove git completely to allow homebrew to update it.
-execute "remove git" do
- command "rm -rf /usr/local/Cellar/git"
+bash "remove git" do
+ code <<~EOH
+ brew uninstall git@2.35.1
+ EOH
+ user "tempadmin"
+end
+
+user "tempadmin" do
+ action :remove
end
include_recipe "git"