Skip to content

Commit

Permalink
Move terraform modules from ./build to ./install
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit Levy authored and Amit Levy committed Nov 1, 2019
1 parent 89e4a92 commit 49f1030
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions build/includes/terraform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
### Deploy cluster with Terraform
terraform-init:
docker run --rm -it $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) bash -c '\
cd $(mount_path)/build && terraform init && gcloud auth application-default login'
cd $(mount_path)/install/terraform && terraform init && gcloud auth application-default login'

terraform-clean:
rm -r ./.terraform
Expand All @@ -32,7 +32,7 @@ ifndef GCP_PROJECT
$(eval GCP_PROJECT=$(shell sh -c "gcloud config get-value project 2> /dev/null"))
endif
$(DOCKER_RUN) bash -c 'export TF_VAR_agones_version=$(AGONES_VERSION) && \
cd $(mount_path)/build && terraform apply -auto-approve -var values_file="" \
cd $(mount_path)/install/terraform && terraform apply -auto-approve -var values_file="" \
-var chart="agones" \
-var "cluster={name=\"$(GCP_CLUSTER_NAME)\", machineType=\"$(GCP_CLUSTER_NODEPOOL_MACHINETYPE)\", \
zone=\"$(GCP_CLUSTER_ZONE)\", project=\"$(GCP_PROJECT)\", \
Expand All @@ -52,7 +52,7 @@ ifndef GCP_PROJECT
$(eval GCP_PROJECT=$(shell sh -c "gcloud config get-value project 2> /dev/null"))
endif
$(DOCKER_RUN) bash -c ' \
cd $(mount_path)/build && terraform apply -auto-approve -var agones_version="$(VERSION)" -var image_registry="$(REGISTRY)" \
cd $(mount_path)/install/terraform && terraform apply -auto-approve -var agones_version="$(VERSION)" -var image_registry="$(REGISTRY)" \
-var pull_policy="$(IMAGE_PULL_POLICY)" \
-var always_pull_sidecar="$(ALWAYS_PULL_SIDECAR)" \
-var image_pull_secret="$(IMAGE_PULL_SECRET)" \
Expand All @@ -64,5 +64,5 @@ endif
$(MAKE) gcloud-auth-cluster

gcloud-terraform-destroy-cluster:
$(DOCKER_RUN) bash -c 'cd $(mount_path)/build && \
$(DOCKER_RUN) bash -c 'cd $(mount_path)/install/terraform && \
terraform destroy -auto-approve'
4 changes: 2 additions & 2 deletions examples/terraform-submodules/aks/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ variable "cluster_name" {
variable "machine_type" {default = "Standard_D2_v2"}

module "aks_cluster" {
source = "git::https://github.com/googleforgames/agones.git//build/modules/aks/?ref=master"
source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/aks/?ref=master"

machine_type = "${var.machine_type}"
cluster_name = "${var.cluster_name}"
}

module "helm_agones" {
source = "git::https://github.com/googleforgames/agones.git//build/modules/helm/?ref=master"
source = "git::https://github.com/googleforgames/agones.git//install/terraform/modules/helm/?ref=master"

agones_version = "${var.agones_version}"
values_file=""
Expand Down
4 changes: 2 additions & 2 deletions examples/terraform-submodules/gke-local/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ variable "project" {
}
module "gke_cluster" {

source = "../../../build/modules/gke"
source = "../../../install/terraform/modules/gke"

cluster = {
"project" = "${var.project}"
Expand All @@ -40,7 +40,7 @@ module "gke_cluster" {

module "helm_agones" {

source = "../../../build/modules/helm"
source = "../../../install/terraform/modules/helm"

agones_version = "${var.agones_version}"
values_file = ""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 49f1030

Please sign in to comment.