Files
stage-infra/Tekton/pipeline/pipeline.yaml
2020-03-16 16:18:59 +01:00

63 lines
1.6 KiB
YAML

---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: stage-application-pipeline
namespace: tekton-pipeline-1
spec:
params:
- name: git-repo-name
description: name of the git repo (used to determine the name of the image)
- name: git-url
description: url of the git repository to clone
- name: branch
description: name of the master branch of the repository
workspaces:
- name: workspace
tasks:
- name: clone
taskRef:
name: git-clone
workspaces:
- name: output
workspace: workspace
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.branch)
- name: build-and-push
taskRef:
name: build-and-push
conditions:
- conditionRef: "is-not-equal"
params:
- name: "left"
value: "stage-infra"
- name: "right"
value: "$(params.git-repo-name)"
runAfter:
- clone
workspaces:
- name: source
workspace: workspace
params:
- name: context
value: "src"
- name: image-name
value: "$(params.git-repo-name)"
- name: version
value: "$(params.branch)"
- name: deploy-app
taskRef:
name: deploy-app
workspaces:
- name: source
workspace: workspace
params:
- name: deploy-name
value: "$(params.git-repo-name)"
- name: deploy-version
value: "$(params.branch)"
runAfter:
- build-and-push