feat: added init app pipeline
This commit is contained in:
parent
97d050f463
commit
665b6d737a
61
pipelines/app-pipeline.yaml
Normal file
61
pipelines/app-pipeline.yaml
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
apiVersion: tekton.dev/v1beta1
|
||||||
|
kind: Pipeline
|
||||||
|
metadata:
|
||||||
|
name: app-pipeline
|
||||||
|
namespace: tekton-pipelines
|
||||||
|
spec:
|
||||||
|
params:
|
||||||
|
- name: app-name
|
||||||
|
- name: git-url
|
||||||
|
- name: git-revision
|
||||||
|
- name: pr-number
|
||||||
|
default: ""
|
||||||
|
- name: event-type
|
||||||
|
workspaces:
|
||||||
|
- name: shared-data
|
||||||
|
tasks:
|
||||||
|
- name: fetch-repository
|
||||||
|
taskRef:
|
||||||
|
name: git-clone
|
||||||
|
workspaces:
|
||||||
|
- name: output
|
||||||
|
workspace: shared-data
|
||||||
|
params:
|
||||||
|
- name: url
|
||||||
|
value: $(params.git-url)
|
||||||
|
- name: revision
|
||||||
|
value: $(params.git-revision)
|
||||||
|
|
||||||
|
# 2. Build and Push Image (using standard Kaniko)
|
||||||
|
- name: build-and-push
|
||||||
|
runAfter: [fetch-repository]
|
||||||
|
taskRef:
|
||||||
|
name: kaniko
|
||||||
|
workspaces:
|
||||||
|
- name: source
|
||||||
|
workspace: shared-data
|
||||||
|
params:
|
||||||
|
- name: IMAGE
|
||||||
|
value: "ghcr.io/pingu-studio/$(params.app-name):$(params.git-revision)"
|
||||||
|
|
||||||
|
# 3. PREVIEW: Runs only on PR
|
||||||
|
- name: deploy-preview
|
||||||
|
when:
|
||||||
|
- input: "$(params.event-type)"
|
||||||
|
operator: in
|
||||||
|
values: ["pull_request"]
|
||||||
|
runAfter: [build-and-push]
|
||||||
|
taskRef:
|
||||||
|
name: manage-preview
|
||||||
|
workspaces:
|
||||||
|
- name: source
|
||||||
|
workspace: shared-data
|
||||||
|
params:
|
||||||
|
- name: app-name
|
||||||
|
value: $(params.app-name)
|
||||||
|
- name: pr-number
|
||||||
|
value: "$(params.pr-number)"
|
||||||
|
- name: image-tag
|
||||||
|
value: "$(params.git-revision)"
|
||||||
|
- name: action
|
||||||
|
value: "apply"
|
||||||
Loading…
Reference in a new issue