Skip to content

Commit 6bc84cb

Browse files
committed
On branch all-in-one-deployment
Your branch is up to date with 'origin/all-in-one-deployment'. Changes to be committed: new file: stacks/all-in-one/main.tf new file: stacks/all-in-one/providers.tf new file: stacks/all-in-one/variables.tf
1 parent 06be38d commit 6bc84cb

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

stacks/all-in-one/main.tf

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
locals {
2+
cluster_dir = "../../projects/cluster"
3+
argocd_dir = "../../projects/argocd"
4+
application_dir = "../../projects/application"
5+
}
6+
7+
# 1) Cluster INIT
8+
resource "null_resource" "cluster_init" {
9+
triggers = {
10+
dir = local.cluster_dir
11+
bump = "1"
12+
}
13+
provisioner "local-exec" {
14+
command = "terraform -chdir=${self.triggers.dir} init -upgrade"
15+
}
16+
}
17+
18+
# 1) Cluster APPLY
19+
resource "null_resource" "cluster_apply" {
20+
triggers = {
21+
init_done = null_resource.cluster_init.id
22+
dir = local.cluster_dir
23+
bump = "1"
24+
}
25+
provisioner "local-exec" {
26+
command = "terraform -chdir=${self.triggers.dir} apply -auto-approve"
27+
}
28+
provisioner "local-exec" {
29+
when = destroy
30+
command = "terraform -chdir=${self.triggers.dir} destroy -auto-approve"
31+
}
32+
}
33+
34+
# 2) Argo CD INIT
35+
resource "null_resource" "argocd_init" {
36+
triggers = {
37+
cluster_done = null_resource.cluster_apply.id
38+
dir = local.argocd_dir
39+
bump = "1"
40+
}
41+
provisioner "local-exec" {
42+
command = "terraform -chdir=${self.triggers.dir} init -upgrade"
43+
}
44+
}
45+
46+
# 2) Argo CD APPLY
47+
resource "null_resource" "argocd_apply" {
48+
triggers = {
49+
init_done = null_resource.argocd_init.id
50+
dir = local.argocd_dir
51+
bump = "1"
52+
}
53+
provisioner "local-exec" {
54+
command = "terraform -chdir=${self.triggers.dir} apply -auto-approve"
55+
}
56+
provisioner "local-exec" {
57+
when = destroy
58+
command = "terraform -chdir=${self.triggers.dir} destroy -auto-approve"
59+
}
60+
}
61+
62+
# 3) Application INIT
63+
resource "null_resource" "application_init" {
64+
triggers = {
65+
argocd_done = null_resource.argocd_apply.id
66+
dir = local.application_dir
67+
bump = "1"
68+
}
69+
provisioner "local-exec" {
70+
command = "terraform -chdir=${self.triggers.dir} init -upgrade"
71+
}
72+
}
73+
74+
# 3) Application APPLY
75+
resource "null_resource" "application_apply" {
76+
triggers = {
77+
init_done = null_resource.application_init.id
78+
dir = local.application_dir
79+
bump = "1"
80+
}
81+
provisioner "local-exec" {
82+
command = "terraform -chdir=${self.triggers.dir} apply -auto-approve"
83+
}
84+
provisioner "local-exec" {
85+
when = destroy
86+
command = "terraform -chdir=${self.triggers.dir} destroy -auto-approve"
87+
}
88+
}

stacks/all-in-one/providers.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
required_version = ">= 1.10.0"
3+
required_providers {
4+
null = {
5+
source = "hashicorp/null"
6+
version = ">= 3.2.4"
7+
}
8+
}
9+
}

stacks/all-in-one/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Minimal inputs — keep everything else defaulted in each project.
2+
3+
variable "cluster_name" {
4+
description = "Minikube profile / kube context used by Application project"
5+
type = string
6+
default = "emumba-minikube-cluster"
7+
}
8+
9+
variable "github_repo_url" {
10+
description = "HTTPS repo URL that Argo CD Application will sync"
11+
type = string
12+
}
13+
14+
variable "github_pat" {
15+
description = "GitHub token with read access"
16+
type = string
17+
sensitive = true
18+
}

0 commit comments

Comments
 (0)