Makefile rule for building all linux binaries, and upload all ARCHs

This commit is contained in:
Cameron Sparr 2015-09-04 14:12:50 -06:00
parent e47801074e
commit 6260dd1018
3 changed files with 20 additions and 4 deletions

View File

@ -6,6 +6,17 @@ build: prepare
"-X main.Version $(VERSION)" \ "-X main.Version $(VERSION)" \
./cmd/telegraf/telegraf.go ./cmd/telegraf/telegraf.go
build-linux-bins: prepare
GOARCH=amd64 GOOS=linux $(GOPATH)/bin/godep go build -o telegraf_linux_amd64 \
-ldflags "-X main.Version $(VERSION)" \
./cmd/telegraf/telegraf.go
GOARCH=386 GOOS=linux $(GOPATH)/bin/godep go build -o telegraf_linux_386 \
-ldflags "-X main.Version $(VERSION)" \
./cmd/telegraf/telegraf.go
GOARCH=arm GOOS=linux $(GOPATH)/bin/godep go build -o telegraf_linux_arm \
-ldflags "-X main.Version $(VERSION)" \
./cmd/telegraf/telegraf.go
prepare: prepare:
go get github.com/tools/godep go get github.com/tools/godep

View File

@ -33,6 +33,9 @@ Latest:
* http://get.influxdb.org/telegraf/telegraf_0.1.8_amd64.deb * http://get.influxdb.org/telegraf/telegraf_0.1.8_amd64.deb
* http://get.influxdb.org/telegraf/telegraf-0.1.8-1.x86_64.rpm * http://get.influxdb.org/telegraf/telegraf-0.1.8-1.x86_64.rpm
Binaries:
* http://get.influxdb.org/telegraf/telegraf_0.1.8_linux_x86_64.tar.gz
0.1.4: 0.1.4:
* http://get.influxdb.org/telegraf/telegraf_0.1.4_amd64.deb * http://get.influxdb.org/telegraf/telegraf_0.1.4_amd64.deb
* http://get.influxdb.org/telegraf/telegraf-0.1.4-1.x86_64.rpm * http://get.influxdb.org/telegraf/telegraf-0.1.4-1.x86_64.rpm

View File

@ -303,13 +303,15 @@ if [ "$CIRCLE_BRANCH" == "" ]; then
echo "Upload failed -- aborting". echo "Upload failed -- aborting".
cleanup_exit 1 cleanup_exit 1
fi fi
rm $filepath
done done
# Upload binaries # Make and upload linux amd64, 386, and arm
for b in ${BINS[*]}; do make build-linux-bins
zippedbin=${b}_${VERSION}_linux_x86_64.tar.gz for b in `ls telegraf_*`; do
zippedbin=${b}_${VERSION}.tar.gz
# Zip the binary # Zip the binary
tar -zcf $TMP_WORK_DIR/$zippedbin -C $GOPATH_INSTALL/bin ./$b tar -zcf $TMP_WORK_DIR/$zippedbin ./$b
echo "Uploading binary: $zippedbin to S3" echo "Uploading binary: $zippedbin to S3"
AWS_CONFIG_FILE=$AWS_FILE aws s3 cp $TMP_WORK_DIR/$zippedbin \ AWS_CONFIG_FILE=$AWS_FILE aws s3 cp $TMP_WORK_DIR/$zippedbin \
s3://get.influxdb.org/telegraf/$zippedbin \ s3://get.influxdb.org/telegraf/$zippedbin \