Skip to content

Commit

Permalink
Copy latest packaging script to 0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Jul 1, 2015
1 parent d644b5d commit c3a55ac
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
# Trim the leading spaces when creating the file. The script will exit if
# S3 upload is requested, but this file does not exist.

[ -z $DEBUG ] || set -x

AWS_FILE=~/aws.conf

INSTALL_ROOT_DIR=/opt/influxdb
Expand All @@ -49,6 +51,12 @@ [email protected]
VENDOR=Influxdb
DESCRIPTION="Distributed time-series database"

# Allow path to FPM to be set by environment variables. Some execution contexts
# like cron don't have PATH set correctly to pick it up.
if [ -z "$FPM" ]; then
FPM=`which fpm`
fi

GO_VERSION="go1.4.2"
GOPATH_INSTALL=
BINS=(
Expand Down Expand Up @@ -289,33 +297,40 @@ if [ -z "$NIGHTLY_BUILD" ]; then
fi

if [ $ARCH == "i386" ]; then
rpm_package=influxdb-$VERSION-1.i686.rpm
rpm_package=influxdb-${VERSION}-1.i686.rpm # RPM packages use 1 for default package release.
debian_package=influxdb_${VERSION}_i686.deb
deb_args="-a i686"
rpm_args="setarch i686"
elif [ $ARCH == "arm" ]; then
rpm_package=influxdb-$VERSION-1.armel.rpm
rpm_package=influxdb-${VERSION}-1.armel.rpm
debian_package=influxdb_${VERSION}_armel.deb
else
rpm_package=influxdb-$VERSION-1.x86_64.rpm
rpm_package=influxdb-${VERSION}-1.x86_64.rpm
debian_package=influxdb_${VERSION}_amd64.deb
fi

COMMON_FPM_ARGS="-C $TMP_WORK_DIR --vendor $VENDOR --url $URL --license $LICENSE --maintainer $MAINTAINER --after-install $POST_INSTALL_PATH --name influxdb --version $VERSION --config-files $CONFIG_ROOT_DIR ."
$rpm_args fpm -s dir -t rpm --description "$DESCRIPTION" $COMMON_FPM_ARGS
$rpm_args $FPM -s dir -t rpm --description "$DESCRIPTION" $COMMON_FPM_ARGS
if [ $? -ne 0 ]; then
echo "Failed to create RPM package -- aborting."
cleanup_exit 1
fi
echo "RPM package created successfully."

fpm -s dir -t deb $deb_args --description "$DESCRIPTION" $COMMON_FPM_ARGS
$FPM -s dir -t deb $deb_args --description "$DESCRIPTION" $COMMON_FPM_ARGS
if [ $? -ne 0 ]; then
echo "Failed to create Debian package -- aborting."
cleanup_exit 1
fi
echo "Debian package created successfully."

$FPM -s dir -t tar --prefix influxdb_${VERSION}_${ARCH} -p influxdb_${VERSION}_${ARCH}.tar.gz --description "$DESCRIPTION" $COMMON_FPM_ARGS
if [ $? -ne 0 ]; then
echo "Failed to create Tar package -- aborting."
cleanup_exit 1
fi
echo "Tar package created successfully."

###########################################################################
# Offer to tag the repo.

Expand Down Expand Up @@ -356,7 +371,7 @@ if [ "x$response" == "xy" -o -n "$NIGHTLY_BUILD" ]; then
cleanup_exit 1
fi

for filepath in `ls *.{deb,rpm}`; do
for filepath in `ls *.{deb,rpm,gz}`; do
filename=`basename $filepath`
if [ -n "$NIGHTLY_BUILD" ]; then
filename=`echo $filename | sed s/$VERSION/nightly/`
Expand Down

0 comments on commit c3a55ac

Please sign in to comment.