Skip to content

Commit

Permalink
Add pre and postun to clean the cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
manegron committed Oct 10, 2024
1 parent d83d090 commit f8212c7
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions packaging/rpm/cookbook-minio.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ chmod -R 0755 %{buildroot}/var/chef/cookbooks/minio
install -D -m 0644 README.md %{buildroot}/var/chef/cookbooks/minio/README.md

%pre
if [ -d /var/chef/cookbooks/minio ]; then
rm -rf /var/chef/cookbooks/minio
fi

%post
case "$1" in
Expand All @@ -36,6 +39,12 @@ case "$1" in
;;
esac

%postun
# Deletes directory when uninstall the package
if [ "$1" = 0 ] && [ -d /var/chef/cookbooks/minio ]; then
rm -rf /var/chef/cookbooks/minio
fi

%files
%defattr(0755,root,root)
/var/chef/cookbooks/minio
Expand All @@ -46,9 +55,14 @@ esac
%doc

%changelog
* Fri Jan 28 2022 David Vanhoucke <dvanhoucke@redborder.com> - 0.0.3-1
* Thu Oct 10 2024 Miguel Negrón <manegron@redborder.com>
- Add pre and postun

* Fri Jan 28 2022 David Vanhoucke <dvanhoucke@redborder.com>
- define attributes and update register to consul
* Fri Jan 07 2022 David Vanhoucke <dvanhoucke@redborder.com> - 0.0.2-1

* Fri Jan 07 2022 David Vanhoucke <dvanhoucke@redborder.com>
- change register to consul
* Wed Jan 24 2018 Alberto Rodriguez <arodriguez@redborder.com> - 0.1.0-1

* Wed Jan 24 2018 Alberto Rodriguez <arodriguez@redborder.com>
- first spec version

0 comments on commit f8212c7

Please sign in to comment.