Skip to content

Commit

Permalink
Addressing #152
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosrodlop committed Jun 24, 2024
1 parent ce85675 commit 5f1b45e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
1 change: 1 addition & 0 deletions .cloudbees/workflows/bp-tf-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ env:
company = "CloudBees Inc."
}
suffix = "ci-v4"
ci = true
jobs:
init:
Expand Down
8 changes: 3 additions & 5 deletions blueprints/01-getting-started/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,11 @@ resource "kubernetes_storage_class_v1" "gp3" {

}

resource "null_resource" "create_kubeconfig" {

# Kubeconfig
resource "terraform_data" "create_kubeconfig" {
depends_on = [module.eks]

triggers = {
always_run = timestamp()
}
triggers_replace = var.ci ? [timestamp()] : []

provisioner "local-exec" {
command = "aws eks update-kubeconfig --name ${module.eks.cluster_name} --region ${local.region} --kubeconfig ${local.kubeconfig_file_path}"
Expand Down
4 changes: 0 additions & 4 deletions blueprints/01-getting-started/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ terraform {
source = "hashicorp/helm"
version = ">= 2.5.1"
}
null = {
source = "hashicorp/null"
version = ">= 3.1.0"
}
}

}
Expand Down
6 changes: 6 additions & 0 deletions blueprints/01-getting-started/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ variable "suffix" {
error_message = "The suffix cannot contain more than 10 characters."
}
}

variable "ci" {
description = "Running in a CI Service vs locally. False when running locally, true when running in a CI service"
default = false
type = bool
}
9 changes: 3 additions & 6 deletions blueprints/02-at-scale/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -643,14 +643,11 @@ resource "kubernetes_storage_class_v1" "efs" {
}

# Kubeconfig

resource "null_resource" "create_kubeconfig" {

resource "terraform_data" "create_kubeconfig" {
depends_on = [module.eks]

triggers = {
always_run = timestamp()
}
triggers_replace = var.ci ? [timestamp()] : []

provisioner "local-exec" {
command = "aws eks update-kubeconfig --name ${module.eks.cluster_name} --region ${local.region} --kubeconfig ${local.kubeconfig_file_path}"
}
Expand Down
5 changes: 0 additions & 5 deletions blueprints/02-at-scale/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ terraform {
version = ">= 0.7.1"
}

null = {
source = "hashicorp/null"
version = ">= 3.1.0"
}

random = {
source = "hashicorp/random"
version = ">= 3.6.1"
Expand Down
6 changes: 6 additions & 0 deletions blueprints/02-at-scale/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ variable "gh_token" {
default = "ExampleToken1234"
type = string
}

variable "ci" {
description = "Running in a CI Service vs locally. False when running locally, true when running in a CI service,"
default = false
type = bool
}

0 comments on commit 5f1b45e

Please sign in to comment.