Skip to content

Instantly share code, notes, and snippets.

@maxlinc
Last active December 20, 2015 02:39
Show Gist options
  • Save maxlinc/6058390 to your computer and use it in GitHub Desktop.
Save maxlinc/6058390 to your computer and use it in GitHub Desktop.
use-go ci-addon for cloudbees
#!/bin/bash
if [[ -z $GOLANG_VERSION ]]; then
GOLANG_VERSION=1.1.1
echo "No version provided for go, will use the last one: $GOLANG_VERSION" 1>&2
fi
set -e
ARCH=`uname -m`
if [ $ARCH = "x86_64" ];
then
ARCH="amd64"
fi
golang_name=go${GOLANG_VERSION}.linux-${ARCH}
echo "Setting up $golang_name"
# https://go.googlecode.com/files/go1.1.1.linux-386.tar.gz
# https://go.googlecode.com/files/go1.1.1.linux-x86_64.tar.gz
golang_dir=/scratch/jenkins/golang/${golang_name}
mkdir -p ${golang_dir}
test -f ${golang_dir}.tar.gz || wget -q -P /scratch/jenkins/golang https://go.googlecode.com/files/${golang_name}.tar.gz
test -f ${golang_dir}/bin/go || tar xzf ${golang_dir}.tar.gz -C ${golang_dir}
export PATH=${golang_dir}/go/bin:$PATH
echo "Go install complete"
echo `go version`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment