diff --git a/share/gitea-tekton-org/postconfig.tf b/share/gitea-tekton-org/postconfig.tf new file mode 100644 index 0000000..6c97296 --- /dev/null +++ b/share/gitea-tekton-org/postconfig.tf @@ -0,0 +1,46 @@ +resource "kubectl_manifest" "postconfig" { + count = var.autoCD?1:0 + yaml_body = <<-EOF + apiVersion: tekton.dev/v1 + kind: TaskRun + metadata: + name: post-config-auto-cd-create + namespace: ${var.namespace} + ownerReferences: ${jsonencode(var.install_owner)} + labels: ${jsonencode(local.common_labels)} + annotations: + mayfly.cloud.namecheap.com/expire: 336h + spec: + params: + - name: artifactory-url + value: git.${var.domain_name} + - name: project-name + value: deploy + - name: project-path + value: ${var.organization}/deploy + - name: git-repository-url + value: ssh://git@${var.gitea_ssh_prefix}.${var.domain_name}:${var.gitea_ssh_port}/${var.organization}/deploy.git + - name: deploy-url + value: ssh://git@${var.gitea_ssh_prefix}.${var.domain_name}:${var.gitea_ssh_port}/${var.organization}/deploy.git + serviceAccountName: default + taskRef: + kind: Task + name: auto-cd-create + timeout: 1h0m0s + workspaces: + - name: source + persistentVolumeClaim: + claimName: source + subPath: postconfig-cd + - name: ssh-directory + secret: + items: + - key: known_hosts + path: known_hosts + - key: ssh-privatekey + path: id_rsa + - key: ssh-publickey + path: id_rsa.pub + secretName: ssh-credentials + EOF +}