Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #28 from circleci/no-terraform-version-check
Browse files Browse the repository at this point in the history
Minor 1.0 fixes
  • Loading branch information
bellkev authored Jul 7, 2017
2 parents 9498b84 + fed1def commit 459166c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
25 changes: 0 additions & 25 deletions bin/terraform
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ set -e
set -o pipefail


is_valid_version() {
valid=('v0.6.14' 'v0.6.15' 'v0.6.16' 'v0.7.0')
for v in "${valid[@]}"; do
if [[ $1 = $v ]]; then
return 0
fi
done
return 1
}

brew_install_terraform() {
brew -v &> /dev/null || return 1
echo "It looks like you have homebrew installed. Would you like to use it to install Terraform?" >&2
Expand Down Expand Up @@ -49,18 +39,6 @@ install_terraform() {
fi
}

handle_unsupported_version() {
echo "It looks like you have an unsupported version (${1}) of Terraform installed. How would you like to proceed?" >&2
echo "1: Install a separate, local Terraform version without touching the system version." >&2
echo "2: Exit. I'll upgrade on my own." >&2
read selection
case "$selection" in
1) local=true install_terraform;;
2) exit 1;;
*) echo "Please enter \"1\" or \"2\" then hit ENTER" >&2; handle_unsupported_version "$1";;
esac
}

terraform_wrapper() {
version=$(terraform -v 2>/dev/null | awk '{print $2}') || true
if [[ -x .dependencies/terraform ]]; then
Expand All @@ -69,9 +47,6 @@ terraform_wrapper() {
elif [[ -z $version ]]; then
install_terraform
terraform_wrapper "$@"
elif ! is_valid_version $version; then
handle_unsupported_version $version
terraform_wrapper "$@"
else
echo "Using system Terraform" >&2
terraform "$@"
Expand Down
1 change: 1 addition & 0 deletions circleci.tf
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ replicated -version || curl https://s3.amazonaws.com/circleci-enterprise/init-se
config_dir=/var/lib/replicated/circle-config
mkdir -p $config_dir
echo '${var.aws_region}' > $config_dir/aws_region
echo '${var.circle_secret_passphrase}' > $config_dir/circle_secret_passphrase
echo '${aws_sqs_queue.shutdown_queue.id}' > $config_dir/sqs_queue_url
echo '${aws_s3_bucket.circleci_bucket.id}' > $config_dir/s3_bucket
Expand Down

1 comment on commit 459166c

@alvarezchristian1406
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

Please sign in to comment.