From 48056eadb7ced07edf92d1389e95b7cd7e78c154 Mon Sep 17 00:00:00 2001 From: Marcin Raba Date: Wed, 31 Jul 2024 21:45:08 +0200 Subject: [PATCH] SNOW-1055755: fix rpm build 2 --- scripts/packaging/build_packages.sh | 76 +++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 16 deletions(-) diff --git a/scripts/packaging/build_packages.sh b/scripts/packaging/build_packages.sh index aef633ffc3..80bdace735 100755 --- a/scripts/packaging/build_packages.sh +++ b/scripts/packaging/build_packages.sh @@ -3,34 +3,78 @@ set -o pipefail VERSION=$(hatch version) THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(git rev-parse --show-toplevel)" ARCH="$(uname -m)" -DEB_PGK="snowflake_cli_${VERSION}.${ARCH}.deb" -RPM_PGK="snowflake_cli_${VERSION}.${ARCH}.rpm" +PKG_NAME="snowflake-cli" +DEB_PGK_FILE_NAME="snowflake_cli_${VERSION}.${ARCH}.deb" +RPM_PGK_FILE_NAME="snowflake_cli_${VERSION}.${ARCH}.rpm" + +echo "-----------------" +echo ${BASH_SOURCE} +echo ${VERSION} +echo ${THIS_DIR} +echo ${ARCH} +echo ${PKG_NAME} +echo ${DEB_PGK_FILE_NAME} +echo ${RPM_PGK_FILE_NAME} + +echo "-----------------" echo "Building deb for version ${VERSION} on ${ARCH}..." +echo ${PKG_NAME} +echo ${VERSION} +echo ${ARCH} +echo ${RPM_PGK_FILE_NAME} +echo ${THIS_DIR} +echo ${ROOT_DIR}/dist/snow/ +pwd + fpm \ -s dir \ -t deb \ - --name snow \ - --version ${VERSION} \ + -n ${PKG_NAME} \ + -v ${VERSION} \ -a native \ + -p ${DEB_PGK_FILE_NAME} \ + -C ${ROOT_DIR}/dist/snow/ \ --prefix /usr/lib/snowflake/snowflake-cli \ - --after-install $THIS_DIR/ubuntu/after_install.sh \ - --after-remove $THIS_DIR/ubuntu/after_remove.sh \ - --force \ - -C ./dist/snow \ - -p ${DEB_PGK} + --after-install ${THIS_DIR}/ubuntu/after_install.sh \ + --after-remove ${THIS_DIR}/ubuntu/after_remove.sh \ + --force + +echo "-----------------" echo "Building rpm for version ${VERSION} on ${ARCH}..." +echo ${PKG_NAME} +echo ${VERSION} +echo ${ARCH} +echo ${RPM_PGK_FILE_NAME} +echo ${THIS_DIR} +echo ${ROOT_DIR}/dist/snow/ +pwd + fpm \ -s dir \ -t rpm \ - --name snow \ - --version ${VERSION} \ + -n ${PKG_NAME} \ + -v ${VERSION} \ -a native \ + -p ${RPM_PGK_FILE_NAME} \ + -C ${ROOT_DIR}/dist/snow/ \ --prefix /usr/lib/snowflake/snowflake-cli \ - --after-install $THIS_DIR/centos/after_install.sh \ - --after-remove $THIS_DIR/centos/after_remove.sh \ - --force \ - -C ./dist/snow \ - -p ${RPM_PKG} + --after-install ${THIS_DIR}/centos/after_install.sh \ + --after-remove ${THIS_DIR}/centos/after_remove.sh \ + --force + +# fpm \ +# -s dir \ +# -t rpm \ +# -n ${PKG_NAME} \ +# -v ${VERSION} \ +# -a native \ +# -p ${RPM_PKG_FILE_NAME} \ +# --prefix /usr/lib/snowflake/snowflake-cli \ +# --after-install ${THIS_DIR}/centos/after_install.sh \ +# --after-remove ${THIS_DIR}/centos/after_remove.sh \ +# --force \ +# ./dist/snow/