fix
This commit is contained in:
@@ -3,10 +3,77 @@ locals {
|
||||
"type" = "branch-push"
|
||||
})
|
||||
tag-labels = merge(local.common-labels, {
|
||||
"type" = "tag-new"
|
||||
"type" = "tag-push"
|
||||
})
|
||||
}
|
||||
|
||||
resource "kubectl_manifest" "auto-ci-detector" {
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: tekton.dev/v1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: auto-ci-detector
|
||||
namespace: "${var.namespace}"
|
||||
labels: ${jsonencode(local.push-labels)}
|
||||
spec:
|
||||
results:
|
||||
- name: stages-prepare
|
||||
description: list of prepare actions
|
||||
type: array
|
||||
- name: stages-lint
|
||||
description: list of lint actions
|
||||
type: array
|
||||
- name: stages-test
|
||||
description: list of test actions
|
||||
type: array
|
||||
- name: stages-publish
|
||||
description: list of publish actions
|
||||
type: array
|
||||
- name: file-shell
|
||||
description: list of shell files if any
|
||||
type: array
|
||||
- name: file-python
|
||||
description: list of python files if any
|
||||
type: array
|
||||
- name: file-docker
|
||||
description: list of Dockerfiles if any
|
||||
type: array
|
||||
- name: images-name
|
||||
description: list of Dockerfiles image-name
|
||||
type: array
|
||||
params:
|
||||
- name: toolbox-image
|
||||
default: sebt3/basic-toolbox-image:1.30.0
|
||||
description: The name of the toolbox image
|
||||
type: string
|
||||
- name: artifactory-url
|
||||
default: docker.io
|
||||
description: The url of the current artifactory
|
||||
type: string
|
||||
- name: project-name
|
||||
description: The name of the current project
|
||||
type: string
|
||||
- name: project-path
|
||||
description: The path of the current project
|
||||
type: string
|
||||
- name: image-version
|
||||
type: string
|
||||
steps:
|
||||
- name: detect-stages
|
||||
image: $(params.toolbox-image)
|
||||
workingDir: $(workspaces.source.path)
|
||||
script: ${file("${path.module}/auto-ci-detector.py")}
|
||||
|
||||
workspaces:
|
||||
- name: source
|
||||
mountPath: /data
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
resource "kubectl_manifest" "ci-trigger-push" {
|
||||
count = var.autoCI?1:0
|
||||
yaml_body = <<-EOF
|
||||
@@ -160,10 +227,20 @@ resource "kubectl_manifest" "ci-trigger-tag" {
|
||||
pipelineRef:
|
||||
name: "auto-ci-tag"
|
||||
params:
|
||||
- name: git-revision
|
||||
value: $(tt.params.gitrevision)
|
||||
- name: artifactory-url
|
||||
value: $(tt.params.artifactory-url)
|
||||
- name: project-name
|
||||
value: $(tt.params.project-name)
|
||||
- name: project-path
|
||||
value: $(tt.params.project-path)
|
||||
- name: git-url
|
||||
value: $(tt.params.gitrepositoryurl)
|
||||
value: $(tt.params.git-repository-url)
|
||||
- name: git-revision
|
||||
value: $(tt.params.git-revision)
|
||||
- name: git-default-branch
|
||||
value: $(tt.params.git-default-branch)
|
||||
- name: branch-name
|
||||
value: $(tt.params.branch-name)
|
||||
workspaces:
|
||||
- name: source
|
||||
volumeClaimTemplate:
|
||||
@@ -176,6 +253,18 @@ resource "kubectl_manifest" "ci-trigger-tag" {
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
- name: dockerconfig
|
||||
secret:
|
||||
secretName: gitea-docker
|
||||
items:
|
||||
- key: ".dockerconfigjson"
|
||||
path: "config.json"
|
||||
- name: sslcertdir
|
||||
secret:
|
||||
secretName: gitea
|
||||
items:
|
||||
- key: "ca.crt"
|
||||
path: "ca.crt"
|
||||
- name: ssh
|
||||
secret:
|
||||
secretName: ssh-credentials
|
||||
@@ -188,3 +277,5 @@ resource "kubectl_manifest" "ci-trigger-tag" {
|
||||
path: "id_rsa.pub"
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user