Last active
August 29, 2015 14:08
-
-
Save byllc/b97ae1110ccc1c2609b7 to your computer and use it in GitHub Desktop.
Install experimental openstack support for terraform.
This file contains hidden or 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
#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 "Add the openstack branch" | |
cd ${GOPATH}/src/github.com/hashicorp/terraform/ | |
git remote add openstack https://github.com/haklop/terraform.git | |
echo "Doing an initial build of plain Terraform" | |
make updatedeps || exit 1 | |
make || exit 1 | |
make dev || exit 1 | |
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/ | |
git fetch openstack | |
git checkout -b openstack-provider openstack/openstack-provider | |
git checkout openstack-provider | |
make dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment