Skip to content
Snippets Groups Projects
build-telegraf.sh 2.02 KiB
Newer Older
#!/bin/bash
#/////////////////////////////////////////////////////////////////////////
#//
#// (c) University of Southampton IT Innovation Centre, 2018
#//
#// Copyright in this software belongs to University of Southampton
#// IT Innovation Centre of Gamma House, Enterprise Road,
#// Chilworth Science Park, Southampton, SO16 7NS, UK.
#//
#// This software may not be used, sold, licensed, transferred, copied
#// or reproduced in whole or in part in any manner or form or in or
#// on any media by any person other than in accordance with the terms
#// of the Licence Agreement supplied with the software, or otherwise
#// without the prior written consent of the copyright owners.
#//
#// This software is distributed WITHOUT ANY WARRANTY, without even the
#// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
#// PURPOSE, except where stated in the Licence Agreement supplied with
#// the software.
#//
#//      Created By :            Michael Boniface
#//      Created Date :          13/12/2017
#//      Updated By :            Nikolay Stanchev
#//      Updated Date :          30/08/2018
#//      Created for Project :   FLAME
#//
#/////////////////////////////////////////////////////////////////////////

# install build prequisites
MJB's avatar
MJB committed
apt-get install ruby ruby-dev rubygems build-essential rpm -y
gem install --no-ri --no-rdoc fpm 

# install go
MJB's avatar
MJB committed
wget https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz -O go1.10.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.10.2.linux-amd64.tar.gz

MJB's avatar
MJB committed
GORC=~/gorc
GOPATH=~/go
# set the environment variables
MJB's avatar
MJB committed
echo 'PATH=$PATH:/usr/local/go/bin' > ${GORC}
echo 'GOPATH=${GOPATH}' >> ${GORC}
source ${GORC}

mkdir $GOPATH

# get telegraf from influx repo
cd $GOPATH
go get -d github.com/influxdata/telegraf

# rebase to it-innovation repo
cd $GOPATH/src/github.com/influxdata/telegraf
git remote add it-innovation https://github.com/it-innovation/telegraf.git
git pull --rebase it-innovation master

# build telegraf
make

# build the packages
MJB's avatar
MJB committed
# chmod 755 ./scripts/*.sh
# make package