Skip to content

Instantly share code, notes, and snippets.

@morhekil
Created November 24, 2014 10:55
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 morhekil/0d790e63974687a19335 to your computer and use it in GitHub Desktop.
Save morhekil/0d790e63974687a19335 to your computer and use it in GitHub Desktop.
guilder - build.sh for go build service
#!/bin/bash
set -e # exit on first error
set -x
BUILD_DIR=/build/go
DIST_DIR=/dist
SRC_DIR=$BUILD_DIR/src/$PKG
source /etc/profile
# Prepare the directory structure
export GOPATH=$BUILD_DIR
# Get the repo auth key
# wget -O ~/.ssh/`basename "$KEY"` "$KEY"
echo "$KEY" > ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa
# Checkout private repositories if they don't exist
if [ ! -d $SRC_DIR ]; then
git clone $GIT $SRC_DIR
fi;
# Symlink the dist dir
ln -s $DIST_DIR ${SRC_DIR}${DIST_DIR}
# Build the project
cd $SRC_DIR
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment