Skip to content

Commit

Permalink
SNOW-1055755: fix rpm build 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mraba committed Jul 31, 2024
1 parent a0905ae commit 48056ea
Showing 1 changed file with 60 additions and 16 deletions.
76 changes: 60 additions & 16 deletions scripts/packaging/build_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit 48056ea

Please sign in to comment.