From 65a6f7a7e21728fff9c405de550418bc69e080e8 Mon Sep 17 00:00:00 2001 From: manegron Date: Thu, 10 Oct 2024 22:19:26 +0100 Subject: [PATCH 1/2] Add pre and postun to clean the cookbook --- packaging/rpm/cookbook-rb-monitor.spec | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/packaging/rpm/cookbook-rb-monitor.spec b/packaging/rpm/cookbook-rb-monitor.spec index bc79716..150b245 100644 --- a/packaging/rpm/cookbook-rb-monitor.spec +++ b/packaging/rpm/cookbook-rb-monitor.spec @@ -23,6 +23,9 @@ chmod -R 0755 %{buildroot}/var/chef/cookbooks/rb-monitor install -D -m 0644 README.md %{buildroot}/var/chef/cookbooks/rb-monitor/README.md %pre +if [ -d /var/chef/cookbooks/rb-monitor ]; then + rm -rf /var/chef/cookbooks/rb-monitor +fi %post case "$1" in @@ -36,6 +39,12 @@ case "$1" in ;; esac +%postun +# Deletes directory when uninstall the package +if [ "$1" = 0 ] && [ -d /var/chef/cookbooks/rb-monitor ]; then + rm -rf /var/chef/cookbooks/rb-monitor +fi + %files %defattr(0755,root,root) /var/chef/cookbooks/rb-monitor @@ -45,11 +54,17 @@ esac %doc %changelog -* Wed Jan 23 2024 David Vanhoucke - 0.0.4-1 +* Thu Oct 10 2024 Miguel Negrón +- Add pre and postun + +* Wed Jan 23 2024 David Vanhoucke - Fix redborder-monitor -* Mon Dec 18 2023 Miguel Álvarez - 0.0.3-1 + +* Mon Dec 18 2023 Miguel Álvarez - Remove logstash from monitor stats -* Tue Apr 18 2023 Luis J. Blanco - 0.0.2-1 + +* Tue Apr 18 2023 Luis J. Blanco - clean templates with helpers -* Tue Oct 18 2016 Alberto Rodríguez - 0.0.1-1 + +* Tue Oct 18 2016 Alberto Rodríguez - first spec version From 41f273ef0d363d6c98f49823eed6bf560f5b358c Mon Sep 17 00:00:00 2001 From: manegron Date: Thu, 10 Oct 2024 22:56:02 +0100 Subject: [PATCH 2/2] Bump version --- CHANGELOG.md | 5 +++++ resources/metadata.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99503da..f4b541d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ cookbook-rb-monitor CHANGELOG =============== +## 0.1.1 + + - Miguel Negrón + - [65a6f7a] Add pre and postun to clean the cookbook + ## 0.1.0 - Daniel Castro diff --git a/resources/metadata.rb b/resources/metadata.rb index 6af5e6e..9a70fee 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -3,4 +3,4 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures rb-monitor' -version '0.1.0' +version '0.1.1'