wazuh / wazuh-indexer

Wazuh indexer, the Wazuh search engine
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
6 stars 16 forks source link

Attempt nr.2 to fix #277 #280

Closed AlexRuiz7 closed 6 days ago

AlexRuiz7 commented 6 days ago

Description

On this PR, I try to fix the missing revision on the DEB package metadata by adding the revision as part of the version.

https://man7.org/linux/man-pages/man1/dpkg-buildpackage.1.html

Issues Resolved

Closes #277

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

f-galland commented 6 days ago

It looks like this works:

fede@tyner:~/src/wazuh-indexer (ci/277-add-revision-as-metadata-to-deb-packages)
$ dpkg -I artifacts/tmp/wazuh-indexer_4.9.0-1_amd64.deb 
 new Debian package, version 2.0.
 size 850530776 bytes: control archive=27762 bytes.
    1704 bytes,    30 lines      conffiles            
     678 bytes,    13 lines      control              
  104147 bytes,  1003 lines      md5sums              
    1602 bytes,    58 lines   *  postinst             #!/bin/bash
    1118 bytes,    31 lines   *  preinst              #!/bin/bash
     828 bytes,    26 lines   *  prerm                #!/bin/bash
 Package: wazuh-indexer
 Version: 4.9.0-1
 Architecture: amd64
 Maintainer: Wazuh Indexer Team <info@wazuh.com>
 Installed-Size: 1051646
 Section: web
 Priority: optional
 Homepage: https://www.wazuh.com/
 Description: Wazuh indexer is a near real-time full-text search and analytics engine that gathers security-related data into one platform.
  This Wazuh central component indexes and stores alerts generated by the Wazuh server.
  Wazuh indexer can be configured as a single-node or multi-node cluster, providing scalability and high availability.
  Documentation can be found at https://documentation.wazuh.com/current/getting-started/components/wazuh-indexer.html
 License: Apache-2.0

But the file name now includes the revision, so we need to accommodate for that as well.


dpkg-deb: building package 'wazuh-indexer' in '../wazuh-indexer_4.9.0-1_amd64.deb'.
make[1]: Leaving directory '/home/wazuh-indexer/artifacts/tmp/deb'
 dpkg-genbuildinfo --build=binary -O../wazuh-indexer_4.9.0-1_amd64.buildinfo
 dpkg-genchanges --build=binary -O../wazuh-indexer_4.9.0-1_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source --after-build .
dpkg-buildpackage: info: binary-only upload (no source included)
I: upon return to the shell, current directory becomes /home/wazuh-indexer/artifacts/tmp/deb
I: please execute "cd .." and inspect the build results.
+ cd ../../..
+ package_name=wazuh-indexer_4.9.0_amd64.deb
+ cp artifacts/tmp/deb/../wazuh-indexer_4.9.0_amd64.deb artifacts/dist/wazuh-indexer_4.9.0_amd64.deb
cp: cannot stat 'artifacts/tmp/deb/../wazuh-indexer_4.9.0_amd64.deb': No such file or directory
AlexRuiz7 commented 6 days ago

Checking the package from the workflow run https://github.com/wazuh/wazuh-indexer/actions/runs/9649524467

dpkg-deb -I wazuh-indexer_4.9.0-0_amd64_a78dcfd.deb     
 paquete Debian nuevo, versión 2.0.
 tamaño 850267136 bytes: archivo de control= 27780 bytes.
    1704 bytes,    30 líneas     conffiles            
     678 bytes,    13 líneas     control              
  104147 bytes,  1003 líneas     md5sums              
    1602 bytes,    58 líneas  *  postinst             #!/bin/bash
    1118 bytes,    31 líneas  *  preinst              #!/bin/bash
     828 bytes,    26 líneas  *  prerm                #!/bin/bash
 Package: wazuh-indexer
 Version: 4.9.0-0
 Architecture: amd64
 Maintainer: Wazuh Indexer Team <info@wazuh.com>
 Installed-Size: 1051397
 Section: web
 Priority: optional
 Homepage: https://www.wazuh.com/
 Description: Wazuh indexer is a near real-time full-text search and analytics engine that gathers security-related data into one platform.
  This Wazuh central component indexes and stores alerts generated by the Wazuh server.
  Wazuh indexer can be configured as a single-node or multi-node cluster, providing scalability and high availability.
  Documentation can be found at https://documentation.wazuh.com/current/getting-started/components/wazuh-indexer.html
 License: Apache-2.0