Skip to content

Instantly share code, notes, and snippets.

@adomenech73
Last active January 4, 2017 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adomenech73/f47efc1b72992e9c9a31f59aa44e1bc1 to your computer and use it in GitHub Desktop.
Save adomenech73/f47efc1b72992e9c9a31f59aa44e1bc1 to your computer and use it in GitHub Desktop.

Compile Influxdb (ubuntu/aarch64)

Requisites

sudo apt-get install bison rubygems ruby-dev libffi-dev asciidoc rpm
sudo gem install fpm

Installing gvm

bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
# reset session
gvm install go1.7.4
gvm use go1.7.4 --default

# especial note for 1.6v (first time)
gvm install go1.4 -B
# -B (binary) this actually dont work in aarch64 so
# manually added env vars
export GOROOT=/usr/lib/go-1.6
export GOROOT_BOOTSTRAP=/usr/lib/go-1.6
# gvm install go1.4 unknown architecture: aarch64
#
gvm use go1.4
export GOROOT_BOOTSTRAP=$GOROOT
gvm install go1.5

Installing GDM

# dependencies manager
go get github.com/sparrc/gdm

Getting the source

mkdir $HOME/gocodez
export GOPATH=$HOME/gocodez
go get github.com/influxdata/influxdb

Build and test

cd $GOPATH/src/github.com/influxdata/influxdb
# get dependencies
gdm restore
# build
go clean ./...
go install ./...

# build packages 
# prerequisite
ln -s /home/ubuntu/.gvm/pkgsets/go1.7.4/global/bin/gdm /home/ubuntu/gocodez/bin/gd
#
python build.py --help

# Or to build a package for your current system
python build.py --package

# To run the tests, execute the following command:
cd $GOPATH/src/github.com/influxdata/influxdb
go test -v ./...

# run tests that match some pattern
go test -run=TestDatabase . -v

# run tests and show coverage
go test -coverprofile /tmp/cover . && go tool cover -html /tmp/cover

# To install go cover, run the following command:

go get golang.org/x/tools/cmd/cover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment