Skip to content

Instantly share code, notes, and snippets.

@rastasheep
Last active August 29, 2015 14:11
Show Gist options
  • Save rastasheep/49d7916bd71bb18764cb to your computer and use it in GitHub Desktop.
Save rastasheep/49d7916bd71bb18764cb to your computer and use it in GitHub Desktop.
Install and setup Go project on Semaphore
VERSION=$1
OWNER=$2
wget "https://storage.googleapis.com/golang/go$VERSION.linux-amd64.tar.gz"
sudo tar -C /usr/local -xzf "go$VERSION.linux-amd64.tar.gz"
sudo ln -s /usr/local/go/bin/go /usr/local/bin/
sudo apt-get install -y mercurial
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bash_profile
mkdir -p /home/runner/workspace/src /home/runner/workspace/bin /home/runner/workspace/pkg
echo "export GOPATH=/home/runner/workspace" >> /home/runner/.bash_profile
echo "export PATH=$PATH:/home/runner/workspace/bin" >> /home/runner/.bash_profile
mkdir -p /home/runner/workspace/src/github.com/$OWNER
cd /home/runner/workspace/src/github.com/$OWNER
ln -s /home/runner/$SEMAPHORE_PROJECT_NAME /home/runner/workspace/src/github.com/$OWNER/
cd /home/runner/workspace/src/github.com/$OWNER/$SEMAPHORE_PROJECT_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment