Skip to content

Commit

Permalink
adapt old deploy script for new terraform state loc
Browse files Browse the repository at this point in the history
  • Loading branch information
martinklepsch committed Dec 10, 2018
1 parent bd31ceb commit d60a8a5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ops/deploy.sh
Expand Up @@ -15,17 +15,19 @@ then
exit 1
fi

tf_opts="-state=ops/terraform.tfstate"
api_ip=$(terraform output "$tf_opts" api_ip)
tf_out_json=$(terraform output "$tf_opts" -json)
tf_out () {
git_root=$(git rev-parse --show-toplevel)
terraform output -state="$git_root/ops/infrastructure/terraform.tfstate" $1
}

api_ip=$(tf_out api_ip)
tf_out_json=$(tf_out -json)

secrets_file=$(mktemp -t cljdoc-secrets.edn)
version_file=$(mktemp -t CLJDOC_VERSION)


echo -e "\nDeploying $version to $api_ip"


echo "$tf_out_json" | ./ops/create-secrets.cljs > "$secrets_file"
echo -e "\nSecrets written to $secrets_file"
echo "$version" > "$version_file"
Expand Down

0 comments on commit d60a8a5

Please sign in to comment.