Skip to content

Commit

Permalink
updated to hopefully work :)
Browse files Browse the repository at this point in the history
  • Loading branch information
punkdata committed Jan 29, 2023
1 parent 9db05d0 commit fcd0062
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
13 changes: 7 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ jobs:
command: |
terraform -chdir=./terraform/digital_ocean/tfcloud apply -auto-approve \
-var org_name=$TF_CLOUD_ORGANIZATION \
-var org_email=$TF_CLOUD_ORG_EMAIL
-var org_email=$TF_CLOUD_ORG_EMAIL \
-var org_workspace_name=$TF_CLOUD_WORKSPACE
create_do_k8s_cluster:
docker:
Expand Down Expand Up @@ -295,8 +296,8 @@ workflows:
- CICD_WORKSHOP_DOCKER
- CICD_WORKSHOP_DIGITAL_OCEAN
- CICD_WORKSHOP_TERRAFORM_CLOUD
- destroy_terraform_cloud:
requires:
- destroy_k8s_cluster
context:
- CICD_WORKSHOP_TERRAFORM_CLOUD
# - destroy_terraform_cloud:
# requires:
# - destroy_k8s_cluster
# context:
# - CICD_WORKSHOP_TERRAFORM_CLOUD
17 changes: 2 additions & 15 deletions terraform/digital_ocean/tfcloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,7 @@ terraform {
version = "~> 0.41.0"
}
}
# cloud {
# # organization = "example_corp"
# workspaces {
# tags = ["app"]
# }
# }
# backend "remote" {
# organization = "circleci-demo"
# workspaces {
# name = "circleci-workshop"
# }
# }
}

resource "tfe_organization" "org" {
name = var.org_name
email = var.org_email
Expand All @@ -32,12 +19,12 @@ resource "tfe_workspace" "ws_iac_do_k8s" {
name = var.workspace_name
organization = var.org_name
execution_mode = var.execution_mode
tag_names = ["k8s-cluster", "cicd-workshop-app"]
tag_names = ["k8s_cluster", "cicd-workshop"]
}

resource "tfe_workspace" "ws_do_k8s_deploy" {
name = "${var.workspace_name}-deployment"
organization = var.org_name
execution_mode = var.execution_mode
tag_names = ["deployment", "cicd-workshop-app"]
tag_names = ["k8s_deployment", "cicd-workshop-app"]
}
2 changes: 1 addition & 1 deletion terraform/digital_ocean/tfcloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ variable "org_email" {
variable "workspace_name" {
type = string
description = "Name of TFC workspace"
default = "circleci-workshop"
# default = "circleci-workshop"
}

variable "execution_mode" {
Expand Down

0 comments on commit fcd0062

Please sign in to comment.