-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathget-terraform.sh
More file actions
executable file
·39 lines (34 loc) · 971 Bytes
/
get-terraform.sh
File metadata and controls
executable file
·39 lines (34 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
have() {
command -v "${@}" >/dev/null 2>/dev/null
}
OS=linux
ARCH=amd64
FUNZIP="${FUNZIP:-funzip}"
if ! have "${FUNZIP}"
then
if have gunzip
then
FUNZIP=gunzip
else
command -V "${FUNZIP}"
exit 1
fi
fi &&
if have go
then
OS="$(go env GOOS)" &&
ARCH="$(go env GOARCH)"
fi &&
# TODO get versions from openshift-installer toml files
TERRAFORM_VERSION="0.12.0-rc1" &&
TERRAFORM_URL="https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${OS}_${ARCH}.zip" &&
echo "pulling ${TERRAFORM_URL}" >&2 &&
cd "$(go env GOPATH)" &&
mkdir -p bin &&
curl -L "${TERRAFORM_URL}" | "${FUNZIP}" >bin/terraform &&
chmod +x bin/terraform
go get -d github.com/terraform-providers/terraform-provider-openstack/
cd "$(go env GOPATH)/src/github.com/terraform-providers/terraform-provider-openstack/" || exit
git checkout b1406b8e4894faad993aff786f0bb50bfec8e281
go get github.com/terraform-providers/terraform-provider-openstack/