charts/pipelines-library/templates/pipelines/helm/gerrit-review-lib.yaml (100 lines of code) (raw):
{{ if has "gerrit" .Values.global.gitProviders }}
{{ if .Values.pipelines.deployableResources.helm }}
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: gerrit-helm-charts-lib-review
labels:
app.edp.epam.com/pipelinetype: review
{{- include "edp-tekton.labels" . | nindent 4 }}
spec:
description: "The Review pipeline for building Helm"
workspaces:
- name: shared-workspace
- name: ssh-creds
params:
- name: pipelineUrl
default: https://portal-{{ .Release.Namespace }}.{{ .Values.global.dnsWildCard }}/c/main/pipelines/$(context.pipelineRun.namespace)/$(context.pipelineRun.name)
type: string
- name: git-source-url
default: "https://github.com/epmd-edp/python-python-python-3.8"
description: git url to clone
type: string
- name: git-source-revision
description: 'git revision to checkout (branch, tag, sha, ref…)'
default: "edp"
type: string
- name: git-refspec
description: Refspec to fetch before checking out revision.
default: ""
type: string
- name: changeNumber
description: Change number from Merge Request
- name: patchsetNumber
description: Patchset number from Merge Request
- name: CODEBASE_NAME
description: "Project name"
type: string
- name: CHART_DIR
description: "The directory in source that contains the helm chart"
default: "charts"
type: string
- name: CT_CONFIGS_DIR
description: "ct-configs directory for helm-lint"
default: "."
type: string
- name: targetBranch
description: "Target branch of Merge Request"
type: string
- name: CHART_VERSION_INCREMENT
description: "Check Chart version increment"
default: 'true'
type: string
tasks:
- name: fetch-repository
taskRef:
kind: Task
name: git-clone
params:
- name: url
value: $(params.git-source-url)
- name: revision
value: $(params.git-source-revision)
- name: refspec
value: $(params.git-refspec)
- name: subdirectory
value: source
workspaces:
- name: output
workspace: shared-workspace
- name: ssh-directory
workspace: ssh-creds
- name: gerrit-notify
taskRef:
kind: Task
name: gerrit-ssh-cmd
params:
- name: GERRIT_PORT
value: '{{ .Values.global.gerritSSHPort }}'
- name: SSH_GERRIT_COMMAND
value: review --verified 0 --message 'Build Started $(params.pipelineUrl)' $(params.changeNumber),$(params.patchsetNumber)
workspaces:
- name: ssh-directory
workspace: ssh-creds
- name: helm-docs
taskRef:
kind: Task
name: helm-library-docs
runAfter:
- gerrit-notify
params:
- name: CHART_DIR
value: $(params.CHART_DIR)
workspaces:
- name: source
workspace: shared-workspace
subPath: source
{{- include "helm-library-review-common" . | nindent 4 }}
{{ include "gerrit-review-vote" . | nindent 2 }}
{{ end }}
{{ end }}