Skip to content

Commit

Permalink
Merge pull request #12 from sjmiller609/master
Browse files Browse the repository at this point in the history
fix helm installation of astronomer
  • Loading branch information
sjmiller609 authored Jul 3, 2019
2 parents 5379268 + 0a6f935 commit 685a5fa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
27 changes: 19 additions & 8 deletions astronomer.tf
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
resource "null_resource" "helm_repo" {
provisioner "local-exec" {
command = <<EOF
set -xe
cd ${path.root}
if [ ! -d ./helm.astronomer.io ]; then
git clone https://github.com/astronomer/helm.astronomer.io.git
cd helm.astronomer.io
git checkout v${var.astronomer_version}
cd ..
fi
cd ${path.root}/helm.astronomer.io
VERSION=$(git rev-parse --abbrev-ref HEAD)
if [ ! $VERSION -eq v${var.astronomer_version} ]; then
cd ..
if [ ! -d ./backups ]; then
mkdir backups
fi
mv helm.astronomer.io backups/helm.astronomer.io.$VERSION.${timestamp()}
git clone https://github.com/astronomer/helm.astronomer.io.git
git checkout v${var.astronomer_version}
fi
cd "./helm.astronomer.io" && \
git checkout ${var.astronomer_version}
EOF
}

provisioner "local-exec" {
when = "destroy"
command = "rm -rf './helm.astronomer.io'"
}

triggers = {
astronomer_version = var.astronomer_version
}
}

# this is for development use
resource "helm_release" "astronomer_local" {
depends_on = ["null_resource.helm_repo"]
depends_on = [null_resource.helm_repo,
kubernetes_secret.astronomer_bootstrap,
kubernetes_secret.astronomer_tls]
name = "astronomer"
version = var.astronomer_version
chart = "./helm.astronomer.io"
Expand Down
3 changes: 2 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ variable "local_umbrella_chart" {
}

variable "astronomer_version" {
default = "v0.9.1-alpha.4"
description = "verison of helm chart to use, do not include a 'v' at the front"
default = "0.9.2"
type = string
}

Expand Down

0 comments on commit 685a5fa

Please sign in to comment.