Skip to content

Commit

Permalink
chore(apps/prod/tekton/config): rename tekton resources
Browse files Browse the repository at this point in the history
Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo committed Sep 2, 2023
1 parent d61ee42 commit 6effe01
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 60 deletions.
66 changes: 10 additions & 56 deletions apps/prod/tekton/configs/pipelines/pipeline1.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: demo-pipeline1
name: demo
spec:
workspaces:
- name: git-source
Expand All @@ -10,30 +10,9 @@ spec:
- name: git-revision
default: main
tasks:
# TODO: using commit-status-tracker to replace explicit tasks.
# https://github.com/tektoncd/experimental/tree/main/commit-status-tracker
- name: set-github-status-start
taskRef:
name: github-set-status
timeout: 1m
params:
- name: git-url
value: $(params.git-url)
- name: sha
value: $(params.git-revision)
- name: description
value: "Build has started"
- name: state
value: pending
- name: context
value: demo-pipeline1
- name: target-url
value: https://tekton/dashboard/taskrun/log
- name: fetch-from-git
taskRef:
name: git-clone
runAfter:
- set-github-status-start
params:
- name: url
value: $(params.git-url)
Expand All @@ -42,42 +21,17 @@ spec:
workspaces:
- name: output
workspace: git-source
- name: go-build
taskRef:
name: golang-build
runAfter:
- fetch-from-git
workspaces:
- name: source
workspace: git-source
params:
- name: packages
value: ./...
- name: go-test
taskRef:
name: golang-test
- name: hello
taskSpec:
steps:
- name: echo
image: debian:latest
script: |
pwd
df -h
echo hello
runAfter:
- fetch-from-git
workspaces:
- name: source
workspace: git-source
params:
- name: packages
value: ./...
finally:
- name: set-github-status-end
taskRef:
name: github-set-status
params:
- name: git-url
value: $(params.git-url)
- name: sha
value: $(params.git-revision)
- name: description
value: "Build has finished"
- name: state
value: success
- name: context
value: demo-pipeline1
- name: target-url
value: https://tekton/dashboard/taskrun/log
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: triggers.tekton.dev/v1beta1
kind: TriggerTemplate
metadata:
name: github-pr-public
name: github-pr-demo
spec:
params:
- name: git-url
Expand All @@ -23,7 +23,7 @@ spec:
"tekton.dev/git-revision": $(tt.params.git-revision)
spec:
pipelineRef:
name: demo-pipeline1
name: demo
params:
- name: git-url
value: $(tt.params.git-url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ spec:
bindings:
- ref: github-pr
template:
ref: github-pr-public
ref: github-pr-demo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- public.yaml
- demo.yaml

0 comments on commit 6effe01

Please sign in to comment.