leborchuk commented on code in PR #13:
URL:
https://github.com/apache/cloudberry-devops-release/pull/13#discussion_r2029108185
##########
scripts/build-deb.sh:
##########
@@ -0,0 +1,148 @@
+#!/bin/bash
+#
+# Script Name: build-deb.sh
+#
+# Description:
+# This script automates the process of building an DEB package using a
specified
+# version number. It ensures that the necessary tools are installed
+# and that the control file exists before attempting to build the DEB. The
script
+# also includes error handling to provide meaningful feedback in case of
failure.
+#
+# Usage:
+# ./build-deb.sh [-v <version>] [-h] [--dry-run]
+#
+# Options:
+# -v, --version <version> : Specify the version (required)
+# -h, --help : Display this help and exit
+# -n, --dry-run : Show what would be done, without making any
changes
+#
+# Example:
+# ./build-deb.sh -v 1.5.5 # Build with version 1.5.5
+#
+# Prerequisites:
+# - The dpkg-buildpackage package must be installed (provides the
dpkg-buildpackage command).
+# - The control file must exist at debian/control.
+#
+# Error Handling:
+# The script includes checks to ensure:
+# - The version option (-v or --version) is provided.
+# - The necessary commands are available.
+# - The control file exists at the specified location.
+# If any of these checks fail, the script exits with an appropriate error
message.
+
+# Enable strict mode for better error handling
+set -euo pipefail
+
+# Default values
+VERSION=""
+RELEASE="1"
+DEBUG_BUILD=false
+
+# Function to display usage information
+usage() {
+ echo "Usage: $0 [-v <version>] [-h] [--dry-run]"
+ echo " -v, --version <version> : Specify the version (optional)"
+ echo " -h, --help : Display this help and exit"
Review Comment:
There is no need to generate it manually, everything is done automatically
since debhelper >= 9.2 https://wiki.debian.org/AutomaticDebugPackages
We have (my test output) files
```
-rw-r--r-- 1 gpadmin root 12103622 Apr 4 16:15
apache-cloudberry-db-incubating-dbgsym_1.6.0-1-._amd64.ddeb
-rw-r--r-- 1 gpadmin root 1163 Apr 4 16:14
apache-cloudberry-db-incubating_1.6.0-1-..dsc
-rw-r--r-- 1 gpadmin root 62554652 Apr 4 16:14
apache-cloudberry-db-incubating_1.6.0-1-..tar.xz
-rw-r--r-- 1 gpadmin root 12427 Apr 4 16:15
apache-cloudberry-db-incubating_1.6.0-1-._amd64.buildinfo
-rw-r--r-- 1 gpadmin root 2318 Apr 4 16:15
apache-cloudberry-db-incubating_1.6.0-1-._amd64.changes
-rw-r--r-- 1 gpadmin root 13566216 Apr 4 16:15
apache-cloudberry-db-incubating_1.6.0-1-._amd64.deb
```
apache-cloudberry-db-incubating-dbgsym_1.6.0-1-._amd64.ddeb package - with
debug symbols
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]