Skip to content

Instantly share code, notes, and snippets.

@halkeye
Created March 19, 2015 18:52
Show Gist options
  • Select an option

  • Save halkeye/53645e3c8cf6edc8feb6 to your computer and use it in GitHub Desktop.

Select an option

Save halkeye/53645e3c8cf6edc8feb6 to your computer and use it in GitHub Desktop.
Quick script to build a complete uchiwa tarball
#!/bin/bash
export GOPATH=`pwd`
set -e
# grab and compile soruce code
go get github.com/sensu/uchiwa
cd $GOPATH/src/github.com/sensu/uchiwa
export VERSION=$(head -n 1 CHANGELOG.md | sed 's/#\+ \([0-9.]\+\).*/\1/g')
export TAR_FILE=${GOPATH}/uchiwa-${VERSION}.tar.gz
if [ -f $TAR_FILE ]; then rm $TAR_FILE; fi
echo $VERSION > VERSION
# install bower
npm install --production
# install dependancies
bower install
# remove files we don't care about
rm -rf bower.json config.json.example Dockerfile uchiwa docker node_modules test .git uchiwa.go .travis.yml
# copy compiled bin
cp $GOPATH/bin/uchiwa ./
cd ..
# create tar file
tar czf $TAR_FILE uchiwa
# get out of tar file path
cd $GOPATH
# cleanup
rm -rf src pkg bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment