From 09656349ca69292a3dd281a4f0c245b74517908d Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 26 Jul 2024 11:44:41 +0530 Subject: [PATCH 1/7] packaging: bundle latest cmk x86 build with deb and rpm packages This uses the latest tag to find and use the latest Github tag from cloudstack-cloudmonkey repo, and use that to bundle the binary CLI in packages. Signed-off-by: Rohit Yadav --- debian/rules | 3 ++- packaging/centos8/cloud.spec | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index b52803702724..97f03a3e9082 100755 --- a/debian/rules +++ b/debian/rules @@ -85,7 +85,8 @@ override_dh_auto_install: rm -rf $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm/md5sum.txt # Bundle cmk in cloudstack-management - wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/6.3.0/cmk.linux.x86-64 -O $(DESTDIR)/usr/bin/cmk + CMK_REL=$(curl -s "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" | jq -r '.[0].name') + wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$CMK_REL/cmk.linux.x86-64 -O $(DESTDIR)/usr/bin/cmk chmod +x $(DESTDIR)/usr/bin/cmk # nast hack for a couple of configuration files diff --git a/packaging/centos8/cloud.spec b/packaging/centos8/cloud.spec index ebb7af125830..8c6d2fb4f686 100644 --- a/packaging/centos8/cloud.spec +++ b/packaging/centos8/cloud.spec @@ -260,7 +260,8 @@ install -D client/target/utilities/bin/cloud-setup-baremetal ${RPM_BUILD_ROOT}%{ install -D client/target/utilities/bin/cloud-sysvmadm ${RPM_BUILD_ROOT}%{_bindir}/%{name}-sysvmadm install -D client/target/utilities/bin/cloud-update-xenserver-licenses ${RPM_BUILD_ROOT}%{_bindir}/%{name}-update-xenserver-licenses # Bundle cmk in cloudstack-management -wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/6.3.0/cmk.linux.x86-64 -O ${RPM_BUILD_ROOT}%{_bindir}/cmk +CMK_REL=$(curl -s "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" | jq -r '.[0].name') +wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$CMK_REL/cmk.linux.x86-64 -O ${RPM_BUILD_ROOT}%{_bindir}/cmk chmod +x ${RPM_BUILD_ROOT}%{_bindir}/cmk cp -r client/target/utilities/scripts/db/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup From e3acecb1c788b7d7cba5c256dfe2521e05bd8e4d Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 26 Jul 2024 14:43:02 +0530 Subject: [PATCH 2/7] Update rules --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 97f03a3e9082..f8e34a938014 100755 --- a/debian/rules +++ b/debian/rules @@ -85,7 +85,7 @@ override_dh_auto_install: rm -rf $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm/md5sum.txt # Bundle cmk in cloudstack-management - CMK_REL=$(curl -s "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" | jq -r '.[0].name') + CMK_REL=$(wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" 2>/dev/null | jq -r '.[0].name') wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$CMK_REL/cmk.linux.x86-64 -O $(DESTDIR)/usr/bin/cmk chmod +x $(DESTDIR)/usr/bin/cmk From 88740aef1179049cd20c27d4f45e9edc2ad4180b Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 26 Jul 2024 14:43:39 +0530 Subject: [PATCH 3/7] Update cloud.spec --- packaging/centos8/cloud.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/centos8/cloud.spec b/packaging/centos8/cloud.spec index 8c6d2fb4f686..7ba755f1bb47 100644 --- a/packaging/centos8/cloud.spec +++ b/packaging/centos8/cloud.spec @@ -260,7 +260,7 @@ install -D client/target/utilities/bin/cloud-setup-baremetal ${RPM_BUILD_ROOT}%{ install -D client/target/utilities/bin/cloud-sysvmadm ${RPM_BUILD_ROOT}%{_bindir}/%{name}-sysvmadm install -D client/target/utilities/bin/cloud-update-xenserver-licenses ${RPM_BUILD_ROOT}%{_bindir}/%{name}-update-xenserver-licenses # Bundle cmk in cloudstack-management -CMK_REL=$(curl -s "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" | jq -r '.[0].name') +CMK_REL=$(wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" 2>/dev/null | jq -r '.[0].name') wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$CMK_REL/cmk.linux.x86-64 -O ${RPM_BUILD_ROOT}%{_bindir}/cmk chmod +x ${RPM_BUILD_ROOT}%{_bindir}/cmk From c2b7be1a57b327c60a5c85a6172e811c1ccc60fc Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 26 Jul 2024 15:44:31 +0530 Subject: [PATCH 4/7] Update rules --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index f8e34a938014..523d79609ecd 100755 --- a/debian/rules +++ b/debian/rules @@ -86,7 +86,7 @@ override_dh_auto_install: # Bundle cmk in cloudstack-management CMK_REL=$(wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" 2>/dev/null | jq -r '.[0].name') - wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$CMK_REL/cmk.linux.x86-64 -O $(DESTDIR)/usr/bin/cmk + wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$(CMK_REL)/cmk.linux.x86-64 -O $(DESTDIR)/usr/bin/cmk chmod +x $(DESTDIR)/usr/bin/cmk # nast hack for a couple of configuration files From 3e734f258ec2556c539a240c2e59c458e709e1e9 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 26 Jul 2024 17:55:23 +0530 Subject: [PATCH 5/7] shell workaround Signed-off-by: Rohit Yadav --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 523d79609ecd..50946d90c22f 100755 --- a/debian/rules +++ b/debian/rules @@ -4,6 +4,7 @@ VERSION := $(shell grep '' pom.xml | head -2 | tail -1 | cut -d'>' -f2 PACKAGE = $(shell dh_listpackages|head -n 1|cut -d '-' -f 1) SYSCONFDIR = "/etc" DESTDIR = "debian/tmp" +CMK_REL := $(shell wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" 2>/dev/null | jq -r '.[0].name') %: dh $@ --with systemd @@ -85,7 +86,6 @@ override_dh_auto_install: rm -rf $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm/md5sum.txt # Bundle cmk in cloudstack-management - CMK_REL=$(wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" 2>/dev/null | jq -r '.[0].name') wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$(CMK_REL)/cmk.linux.x86-64 -O $(DESTDIR)/usr/bin/cmk chmod +x $(DESTDIR)/usr/bin/cmk From f504a8aea71c996e0b02c74e3d28b4acfc896c85 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 29 Jul 2024 09:14:39 +0200 Subject: [PATCH 6/7] Update debian/rules --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 50946d90c22f..e7ff6759d446 100755 --- a/debian/rules +++ b/debian/rules @@ -4,7 +4,7 @@ VERSION := $(shell grep '' pom.xml | head -2 | tail -1 | cut -d'>' -f2 PACKAGE = $(shell dh_listpackages|head -n 1|cut -d '-' -f 1) SYSCONFDIR = "/etc" DESTDIR = "debian/tmp" -CMK_REL := $(shell wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" 2>/dev/null | jq -r '.[0].name') +CMK_REL := $(shell wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/releases" 2>/dev/null | jq -r '.[0].tag_name') %: dh $@ --with systemd From 9360ff38f36655315858b1d78c2ba3c9635a706a Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 29 Jul 2024 09:15:58 +0200 Subject: [PATCH 7/7] Update packaging/centos8/cloud.spec --- packaging/centos8/cloud.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/centos8/cloud.spec b/packaging/centos8/cloud.spec index 7ba755f1bb47..3b801f0f1f35 100644 --- a/packaging/centos8/cloud.spec +++ b/packaging/centos8/cloud.spec @@ -260,7 +260,7 @@ install -D client/target/utilities/bin/cloud-setup-baremetal ${RPM_BUILD_ROOT}%{ install -D client/target/utilities/bin/cloud-sysvmadm ${RPM_BUILD_ROOT}%{_bindir}/%{name}-sysvmadm install -D client/target/utilities/bin/cloud-update-xenserver-licenses ${RPM_BUILD_ROOT}%{_bindir}/%{name}-update-xenserver-licenses # Bundle cmk in cloudstack-management -CMK_REL=$(wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/tags" 2>/dev/null | jq -r '.[0].name') +CMK_REL=$(wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/releases" 2>/dev/null | jq -r '.[0].tag_name') wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$CMK_REL/cmk.linux.x86-64 -O ${RPM_BUILD_ROOT}%{_bindir}/cmk chmod +x ${RPM_BUILD_ROOT}%{_bindir}/cmk