Skip to content

Instantly share code, notes, and snippets.

@zzamboni
Forked from byllc/openstack-terraform.sh
Last active August 29, 2015 14:08
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 zzamboni/38f04d427290bc4f2787 to your computer and use it in GitHub Desktop.
Save zzamboni/38f04d427290bc4f2787 to your computer and use it in GitHub Desktop.
#first make sure go, git and mercurial are installed.
if [[ -z $(which git) ]]; then
echo "Git must be installed"
exit 1
fi
if [[ -z $(which hg) ]]; then
echo "mercurial must be installed"
exit 1
fi
if [[ -z $(which go) ]]; then
echo "Go must be installed"
exit 1
fi
if [[ -z $(which make) ]]; then
echo "make must be installed"
exit 1
fi
if [[ -z "$GOPATH" ]]; then
export GOPATH=$HOME/go
echo "Setting GOPATH to $GOPATH"
mkdir -p $GOPATH
else
echo "Using existing GOPATH ($GOPATH)"
fi
export PATH=$PATH:$GOPATH/bin
echo "Installing GOX"
go get -u github.com/mitchellh/gox
go install github.com/mitchellh/gox
echo "Get the terraform source code"
mkdir -p ${GOPATH}/src/github.com/hashicorp/
cd ${GOPATH}/src/github.com/hashicorp/
git clone https://github.com/hashicorp/terraform.git terraform
cd terraform
echo "Doing an initial build of plain Terraform"
make updatedeps || exit 1
make || exit 1
make dev || exit 1
echo "Add the openstack branch"
cd ${GOPATH}/src/github.com/hashicorp/terraform/
git remote add openstack https://github.com/haklop/terraform.git
git fetch openstack
git checkout -b openstack-provider openstack/openstack-provider
echo "Get gophercloud release version 0.1.1"
go get github.com/rackspace/gophercloud
cd ${GOPATH}/src/github.com/rackspace/gophercloud/
git branch -a
git checkout release/v0.1.1
echo "Install Golang Pretty dependency for gophercloud"
go get github.com/tonnerre/golang-pretty
go install github.com/tonnerre/golang-pretty
echo "Install gophercloud"
go install github.com/rackspace/gophercloud
echo "Install development release of terraform"
cd ${GOPATH}/src/github.com/hashicorp/terraform/
make dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment