Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package.sh: upload raw binaries to S3 #166

Merged
merged 1 commit into from
Sep 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [#150](https://github.com/influxdb/telegraf/pull/150): Add Host Uptime metric to system plugin
- [#158](https://github.com/influxdb/telegraf/pull/158): Apache Plugin. Thanks @KPACHbIuLLIAnO4
- [#165](https://github.com/influxdb/telegraf/pull/165): Add additional metrics to mysql plugin. Thanks @nickscript0
- [#166](https://github.com/influxdb/telegraf/pull/166): Upload binaries to S3

### Bugfixes

Expand Down
25 changes: 23 additions & 2 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ else
debian_package=telegraf_${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 telegraf --version $VERSION --config-files $CONFIG_ROOT_DIR ."
COMMON_FPM_ARGS="-C $TMP_WORK_DIR --vendor $VENDOR --url $URL --license $LICENSE \
--maintainer $MAINTAINER --after-install $POST_INSTALL_PATH \
--name telegraf --version $VERSION --config-files $CONFIG_ROOT_DIR ."
$rpm_args fpm -s dir -t rpm --description "$DESCRIPTION" $COMMON_FPM_ARGS
if [ $? -ne 0 ]; then
echo "Failed to create RPM package -- aborting."
Expand Down Expand Up @@ -289,16 +291,35 @@ if [ "$CIRCLE_BRANCH" == "" ]; then
cleanup_exit 1
fi

# Upload .deb and .rpm packages
for filepath in `ls *.{deb,rpm}`; do
echo "Uploading $filepath to S3"
filename=`basename $filepath`
echo "Uploading $filename to s3://get.influxdb.org/telegraf/$filename"
AWS_CONFIG_FILE=$AWS_FILE aws s3 cp $filepath s3://get.influxdb.org/telegraf/$filename --acl public-read --region us-east-1
AWS_CONFIG_FILE=$AWS_FILE aws s3 cp $filepath \
s3://get.influxdb.org/telegraf/$filename \
--acl public-read --region us-east-1
if [ $? -ne 0 ]; then
echo "Upload failed -- aborting".
cleanup_exit 1
fi
done

# Upload binaries
for b in ${BINS[*]}; do
bin = $GOPATH_INSTALL/bin/$b
zippedbin = $b_$VERSION_linux_x86_64.tar.gz
# Zip the binary
tar -zcf $TMP_WORK_DIR/$zippedbin $bin
echo "Uploading binary: $zippedbin to S3"
AWS_CONFIG_FILE=$AWS_FILE aws s3 cp $TMP_WORK_DIR/$zippedbin \
s3://get.influxdb.org/telegraf/$zippedbin \
--acl public-read --region us-east-1
if [ $? -ne 0 ]; then
echo "Binary upload failed -- aborting".
cleanup_exit 1
fi
done
else
echo "Not publishing packages to S3."
fi
Expand Down