6174a47924
The build system was hardcoded to produce a package that is prefixed with scylla instead of the product name. This is not in line with out CI system requirements and can be also a source for confusion. This commit make the packaging system generate a package of the format: {product}-jmx-package.tar.gz instead of scylla-jmx-package.tar.gz Closes #146
70 lines
1.5 KiB
Bash
Executable File
70 lines
1.5 KiB
Bash
Executable File
#!/bin/bash -e
|
|
|
|
. /etc/os-release
|
|
|
|
print_usage() {
|
|
echo "build_reloc.sh --clean --nodeps"
|
|
echo " --clean clean build directory"
|
|
echo " --nodeps skip installing dependencies"
|
|
echo " --version V product-version-release string (overriding SCYLLA-VERSION-GEN)"
|
|
exit 1
|
|
}
|
|
|
|
CLEAN=
|
|
NODEPS=
|
|
VERSION_OVERRIDE=
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
"--clean")
|
|
CLEAN=yes
|
|
shift 1
|
|
;;
|
|
"--nodeps")
|
|
NODEPS=yes
|
|
shift 1
|
|
;;
|
|
"--version")
|
|
VERSION_OVERRIDE="$2"
|
|
shift 2
|
|
;;
|
|
*)
|
|
print_usage
|
|
;;
|
|
esac
|
|
done
|
|
|
|
VERSION=$(./SCYLLA-VERSION-GEN ${VERSION_OVERRIDE:+ --version "$VERSION_OVERRIDE"})
|
|
# the former command should generate build/SCYLLA-PRODUCT-FILE and some other version
|
|
# related files
|
|
PRODUCT=`cat build/SCYLLA-PRODUCT-FILE`
|
|
|
|
is_redhat_variant() {
|
|
[ -f /etc/redhat-release ]
|
|
}
|
|
is_debian_variant() {
|
|
[ -f /etc/debian_version ]
|
|
}
|
|
|
|
|
|
if [ ! -e reloc/build_reloc.sh ]; then
|
|
echo "run build_reloc.sh in top of scylla dir"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$CLEAN" = "yes" ]; then
|
|
rm -rf build target
|
|
fi
|
|
|
|
if [ -f build/$PRODUCT-jmx-package.tar.gz ]; then
|
|
rm build/$PRODUCT-jmx-package.tar.gz
|
|
fi
|
|
|
|
if [ -z "$NODEPS" ]; then
|
|
sudo ./install-dependencies.sh
|
|
fi
|
|
|
|
mvn -B --file scylla-jmx-parent/pom.xml install
|
|
./SCYLLA-VERSION-GEN ${VERSION_OVERRIDE:+ --version "$VERSION_OVERRIDE"}
|
|
./dist/debian/debian_files_gen.py
|
|
scripts/create-relocatable-package.py build/$PRODUCT-jmx-package.tar.gz
|