Support building race-enabled packages

This will allow testing to run without need to perform special builds,
simply download and install the race-detection-enabled package.
pull/4364/head
Philip O'Toole 2015-10-07 21:43:15 -07:00
parent 4c64c79f3d
commit 880f55565e
1 changed files with 13 additions and 16 deletions

View File

@ -83,6 +83,7 @@ $0 [-h] [-p|-w] [-t <dist>] [-r <number>] <version>
-r release candidate number, if any.
Example: -r 7
-p just build packages
-x build with race-detection enabled
-w build packages for current working directory
imply -p
-t <dist>
@ -264,7 +265,7 @@ do_build() {
fi
date=`date -u --iso-8601=seconds`
go install -a -ldflags="-X main.version=$version -X main.branch=$branch -X main.commit=$commit -X main.buildTime='$date'" ./...
go install $RACE -a -ldflags="-X main.version=$version -X main.branch=$branch -X main.commit=$commit -X main.buildTime='$date'" ./...
if [ $? -ne 0 ]; then
echo "Build failed, unable to create package -- aborting"
cleanup_exit 1
@ -357,6 +358,11 @@ do
shift 2
;;
-x)
RACE="-race"
shift
;;
-w | --working-directory)
PACKAGES_ONLY="PACKAGES_ONLY"
WORKING_DIR="WORKING_DIR"
@ -482,19 +488,6 @@ if [ -z "$NIGHTLY_BUILD" -a -z "$PACKAGES_ONLY" ]; then
fi
fi
if [ $ARCH == "i386" ]; then
rpm_package=influxdb-${VERSION}-1.i686.rpm # RPM packages use 1 for default package release.
debian_package=influxdb_`full_version $VERSION $RC`_i686.deb
deb_args="-a i686"
rpm_args="setarch i686"
elif [ $ARCH == "arm" ]; then
rpm_package=influxdb-${VERSION}-1.armel.rpm
debian_package=influxdb_`full_version $VERSION $RC`_armel.deb
else
rpm_package=influxdb-${VERSION}-1.x86_64.rpm
debian_package=influxdb_`full_version $VERSION $RC`_amd64.deb
fi
COMMON_FPM_ARGS="\
--log error \
-C $TMP_WORK_DIR \
@ -504,7 +497,7 @@ COMMON_FPM_ARGS="\
--maintainer $MAINTAINER \
--after-install $POST_INSTALL_PATH \
--after-remove $POST_UNINSTALL_PATH \
--name influxdb \
--name influxdb${RACE} \
--config-files $CONFIG_ROOT_DIR \
--config-files $LOGROTATE_DIR"
@ -518,7 +511,11 @@ if [ -n "$DEB_WANTED" ]; then
fi
if [ -n "$TAR_WANTED" ]; then
$FPM -s dir -t tar --prefix influxdb_`full_version $VERSION $RC`_${ARCH} -p influxdb_`full_version $VERSION $RC`_${ARCH}.tar.gz --description "$DESCRIPTION" $COMMON_FPM_ARGS --version `full_version $VERSION $RC ` .
if [ -n "$RACE" ]; then
# Tweak race prefix for tarball.
race="race_"
fi
$FPM -s dir -t tar --prefix influxdb_$race`full_version $VERSION $RC`_${ARCH} -p influxdb_$race`full_version $VERSION $RC`_${ARCH}.tar.gz --description "$DESCRIPTION" $COMMON_FPM_ARGS --version `full_version $VERSION $RC ` .
if [ $? -ne 0 ]; then
echo "Failed to create Tar package -- aborting."
cleanup_exit 1