Skip to content

Commit

Permalink
fix #10158
Browse files Browse the repository at this point in the history
  • Loading branch information
just-mitch committed Nov 26, 2024
1 parent cb4ca5d commit b8bfc1f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
11 changes: 9 additions & 2 deletions spartan/terraform/deploy-release/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash

RELEASE_NAME="rough-rhino"
# Usage: ./deploy.sh <release_name> <aztec_docker_image>
# Example: ./deploy.sh rough-rhino aztecprotocol/aztec:698cd3d62680629a3f1bfc0f82604534cedbccf3-x86_64

set -eu

RELEASE_NAME=$1
AZTEC_DOCKER_IMAGE=$2

terraform init -backend-config="key=deploy-network/${RELEASE_NAME}/terraform.tfstate"
terraform apply -var-file="release.tfvars"
terraform apply -var-file="release.tfvars" -var="RELEASE_NAME=${RELEASE_NAME}" -var="AZTEC_DOCKER_IMAGE=${AZTEC_DOCKER_IMAGE}"
12 changes: 6 additions & 6 deletions spartan/terraform/deploy-release/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,32 @@ terraform {
provider "kubernetes" {
alias = "gke-cluster"
config_path = "~/.kube/config"
config_context = var.gke_cluster_context
config_context = var.GKE_CLUSTER_CONTEXT
}

provider "helm" {
alias = "gke-cluster"
kubernetes {
config_path = "~/.kube/config"
config_context = var.gke_cluster_context
config_context = var.GKE_CLUSTER_CONTEXT
}
}

# Aztec Helm release for gke-cluster
resource "helm_release" "aztec-gke-cluster" {
provider = helm.gke-cluster
name = var.release_name
name = var.RELEASE_NAME
repository = "../../"
chart = "aztec-network"
namespace = var.release_name
namespace = var.RELEASE_NAME
create_namespace = true

# base values file
values = [file("../../aztec-network/values/${var.values_file}")]
values = [file("../../aztec-network/values/${var.VALUES_FILE}")]

set {
name = "images.aztec.image"
value = var.aztec_docker_image
value = var.AZTEC_DOCKER_IMAGE
}

# Setting timeout and wait conditions
Expand Down
5 changes: 1 addition & 4 deletions spartan/terraform/deploy-release/release.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
release_name = "rough-rhino"
values_file = "release.yaml"
aztec_docker_image = "aztecprotocol/aztec:698cd3d62680629a3f1bfc0f82604534cedbccf3-x86_64"

VALUES_FILE = "release.yaml"
8 changes: 4 additions & 4 deletions spartan/terraform/deploy-release/variables.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
variable "gke_cluster_context" {
variable "GKE_CLUSTER_CONTEXT" {
description = "GKE cluster context"
type = string
default = "gke_testnet-440309_us-east4-a_spartan-gke"
}

variable "release_name" {
variable "RELEASE_NAME" {
description = "Name of helm deployment and k8s namespace"
type = string
}

variable "values_file" {
variable "VALUES_FILE" {
description = "Name of the values file to use for deployment"
type = string
}

variable "aztec_docker_image" {
variable "AZTEC_DOCKER_IMAGE" {
description = "Docker image to use for the aztec network"
type = string
}

0 comments on commit b8bfc1f

Please sign in to comment.