Created
November 24, 2014 10:55
-
-
Save morhekil/0d790e63974687a19335 to your computer and use it in GitHub Desktop.
guilder - build.sh for go build service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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