fix
This commit is contained in:
@@ -250,6 +250,16 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
gitea_ssh_port:
|
||||||
|
default: 2222
|
||||||
|
examples:
|
||||||
|
- 2222
|
||||||
|
type: integer
|
||||||
|
gitea_ssh_prefix:
|
||||||
|
default: git
|
||||||
|
examples:
|
||||||
|
- git
|
||||||
|
type: string
|
||||||
haveFlux:
|
haveFlux:
|
||||||
default: false
|
default: false
|
||||||
examples:
|
examples:
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ resource "kubectl_manifest" "organisations" {
|
|||||||
"haveTekton" = var.haveTekton
|
"haveTekton" = var.haveTekton
|
||||||
"haveFlux" = var.haveFlux
|
"haveFlux" = var.haveFlux
|
||||||
"autoCD" = var.autoCD
|
"autoCD" = var.autoCD
|
||||||
|
"gitea_ssh_prefix" = var.gitea_ssh_prefix
|
||||||
|
"gitea_ssh_port" = var.gitea_ssh_port
|
||||||
},
|
},
|
||||||
{ for k, v in local.sorted-organisations[count.index] : k => v if !contains(["name"], k) }
|
{ for k, v in local.sorted-organisations[count.index] : k => v if !contains(["name"], k) }
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -85,12 +85,49 @@ resource "kubectl_manifest" "auto-ci-detector" {
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "kubectl_manifest" "ci-git-repo" {
|
||||||
|
count = var.haveFlux?1:0
|
||||||
|
yaml_body = <<-EOF
|
||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: GitRepository
|
||||||
|
metadata:
|
||||||
|
name: "${var.instance}-${var.component}-ci"
|
||||||
|
namespace: "${var.namespace}"
|
||||||
|
labels: ${jsonencode(local.push-labels)}
|
||||||
|
spec:
|
||||||
|
interval: 5m0s
|
||||||
|
ref:
|
||||||
|
branch: main
|
||||||
|
secretRef:
|
||||||
|
name: ssh-credentials
|
||||||
|
url: ssh://git@${var.gitea_ssh_prefix}.${var.domain_name}:${var.gitea_ssh_port}/${var.organization}/deploy.git
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
resource "kubectl_manifest" "ci-kustomization" {
|
||||||
|
count = var.haveFlux?1:0
|
||||||
|
yaml_body = <<-EOF
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: "${var.instance}-${var.component}-ci"
|
||||||
|
namespace: "${var.namespace}"
|
||||||
|
labels: ${jsonencode(local.push-labels)}
|
||||||
|
spec:
|
||||||
|
interval: 5m
|
||||||
|
path: ./ci
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: "${var.instance}-${var.component}-ci"
|
||||||
|
timeout: 1m
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
resource "kubectl_manifest" "ci-trigger-push" {
|
resource "kubectl_manifest" "ci-trigger-push" {
|
||||||
count = var.haveFlux?0:1
|
count = var.haveFlux?0:1
|
||||||
yaml_body = <<-EOF
|
yaml_body = <<-EOF
|
||||||
apiVersion: triggers.tekton.dev/v1beta1
|
apiVersion: triggers.tekton.dev/v1beta1
|
||||||
kind: Trigger
|
kind: Trigger
|
||||||
metadata:
|
|
||||||
metadata:
|
metadata:
|
||||||
name: "${var.instance}-${var.component}-auto-push"
|
name: "${var.instance}-${var.component}-auto-push"
|
||||||
namespace: "${var.namespace}"
|
namespace: "${var.namespace}"
|
||||||
|
|||||||
@@ -21,6 +21,16 @@ options:
|
|||||||
examples:
|
examples:
|
||||||
- your_company.com
|
- your_company.com
|
||||||
type: string
|
type: string
|
||||||
|
gitea_ssh_port:
|
||||||
|
default: 2222
|
||||||
|
examples:
|
||||||
|
- 2222
|
||||||
|
type: integer
|
||||||
|
gitea_ssh_prefix:
|
||||||
|
default: git
|
||||||
|
examples:
|
||||||
|
- git
|
||||||
|
type: string
|
||||||
haveFlux:
|
haveFlux:
|
||||||
default: false
|
default: false
|
||||||
examples:
|
examples:
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ data:
|
|||||||
template deploy-policy-default.yaml.tmpl "stages/${STAGE}/deploy/${PROJECT_NAME}/policy.yaml"
|
template deploy-policy-default.yaml.tmpl "stages/${STAGE}/deploy/${PROJECT_NAME}/policy.yaml"
|
||||||
fi
|
fi
|
||||||
copy empty-kusto.yaml "stages/${STAGE}/deploy/kustomization.yaml"
|
copy empty-kusto.yaml "stages/${STAGE}/deploy/kustomization.yaml"
|
||||||
|
add_resources "../../../bases/deploy" "stages/${STAGE}/deploy/kustomization.yaml"
|
||||||
template stage-kusto.yaml.tmpl "stages/${STAGE}/${PROJECT_NAME}/kustomization.yaml"
|
template stage-kusto.yaml.tmpl "stages/${STAGE}/${PROJECT_NAME}/kustomization.yaml"
|
||||||
template stage-ingress.yaml.tmpl "stages/${STAGE}/${PROJECT_NAME}/ingress.yaml"
|
template stage-ingress.yaml.tmpl "stages/${STAGE}/${PROJECT_NAME}/ingress.yaml"
|
||||||
template stage-cert.yaml.tmpl "stages/${STAGE}/${PROJECT_NAME}/cert.yaml"
|
template stage-cert.yaml.tmpl "stages/${STAGE}/${PROJECT_NAME}/cert.yaml"
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ resource "kubectl_manifest" "tekton" {
|
|||||||
stages: ${jsonencode(local.sorted-stage-name)}
|
stages: ${jsonencode(local.sorted-stage-name)}
|
||||||
haveFlux: ${jsonencode(var.haveFlux)}
|
haveFlux: ${jsonencode(var.haveFlux)}
|
||||||
autoCD: ${jsonencode(var.autoCD)}
|
autoCD: ${jsonencode(var.autoCD)}
|
||||||
|
gitea_ssh_prefix: ${jsonencode(var.gitea_ssh_prefix)}
|
||||||
|
gitea_ssh_port: ${jsonencode(var.gitea_ssh_port)}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,16 @@ options:
|
|||||||
examples:
|
examples:
|
||||||
- ''
|
- ''
|
||||||
type: string
|
type: string
|
||||||
|
gitea_ssh_port:
|
||||||
|
default: 2222
|
||||||
|
examples:
|
||||||
|
- 2222
|
||||||
|
type: integer
|
||||||
|
gitea_ssh_prefix:
|
||||||
|
default: git
|
||||||
|
examples:
|
||||||
|
- git
|
||||||
|
type: string
|
||||||
haveFlux:
|
haveFlux:
|
||||||
default: false
|
default: false
|
||||||
examples:
|
examples:
|
||||||
|
|||||||
Reference in New Issue
Block a user