Add test job for onedev integration.
This commit is contained in:
parent
781f9936dd
commit
687fbe6284
|
|
@ -0,0 +1,23 @@
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: test-trigger-check
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: test-trigger-check
|
||||||
|
image: docker.io/debian:bullseye-slim
|
||||||
|
env:
|
||||||
|
- name: http_proxy
|
||||||
|
value: http://squid-service:3128
|
||||||
|
command: ["bash"]
|
||||||
|
args:
|
||||||
|
- "-c"
|
||||||
|
- >-
|
||||||
|
apt update -y &&
|
||||||
|
apt upgrade -y &&
|
||||||
|
apt install -y curl &&
|
||||||
|
curl -X POST http://el-test-pipeline-listener.default.svc.cluster.local:8080 -H 'Content-Type: application/json' -d '{}'
|
||||||
|
restartPolicy: Never
|
||||||
|
backoffLimit: 0
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
# A pipeline to test the infrasture around calling pipelines.
|
||||||
|
---
|
||||||
|
apiVersion: tekton.dev/v1beta1
|
||||||
|
kind: Pipeline
|
||||||
|
metadata:
|
||||||
|
name: test-pipeline
|
||||||
|
spec:
|
||||||
|
description: "A test pipeline."
|
||||||
|
workspaces:
|
||||||
|
- name: shared-data
|
||||||
|
description: Shared data.
|
||||||
|
- name: git-credentials
|
||||||
|
description: tekton git credentials
|
||||||
|
tasks:
|
||||||
|
- name: fetch-repo
|
||||||
|
workspaces:
|
||||||
|
- name: output
|
||||||
|
workspace: shared-data
|
||||||
|
- name: ssh-directory
|
||||||
|
workspace: git-credentials
|
||||||
|
params:
|
||||||
|
- name: url
|
||||||
|
value: ssh://git.jpace121.net:2222/job-test
|
||||||
|
- name: branch
|
||||||
|
value: master
|
||||||
|
taskRef:
|
||||||
|
name: j7s-git-clone
|
||||||
|
- name: cat-readme
|
||||||
|
runAfter: ["fetch-repo"]
|
||||||
|
workspaces:
|
||||||
|
- name: source
|
||||||
|
workspace: shared-data
|
||||||
|
taskSpec:
|
||||||
|
workspaces:
|
||||||
|
- name: source
|
||||||
|
steps:
|
||||||
|
- image: docker.io/debian:bullseye-slim
|
||||||
|
script: |
|
||||||
|
set -x
|
||||||
|
cat $(workspaces.source.path)/README.md
|
||||||
|
exit 0
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
---
|
||||||
|
apiVersion: triggers.tekton.dev/v1beta1
|
||||||
|
kind: EventListener
|
||||||
|
metadata:
|
||||||
|
name: test-pipeline-listener
|
||||||
|
spec:
|
||||||
|
serviceAccountName: tekton-bot
|
||||||
|
triggers:
|
||||||
|
- name: test-pipeline-trigger
|
||||||
|
bindings:
|
||||||
|
- ref: test-pipeline-binding
|
||||||
|
template:
|
||||||
|
ref: test-pipeline-template
|
||||||
|
resources:
|
||||||
|
kubernetesResource:
|
||||||
|
serviceType: ClusterIP
|
||||||
|
---
|
||||||
|
apiVersion: triggers.tekton.dev/v1beta1
|
||||||
|
kind: TriggerBinding
|
||||||
|
metadata:
|
||||||
|
name: test-pipeline-binding
|
||||||
|
spec:
|
||||||
|
params:
|
||||||
|
- name: empty
|
||||||
|
value: empty
|
||||||
|
---
|
||||||
|
apiVersion: triggers.tekton.dev/v1beta1
|
||||||
|
kind: TriggerTemplate
|
||||||
|
metadata:
|
||||||
|
name: test-pipeline-template
|
||||||
|
spec:
|
||||||
|
params:
|
||||||
|
- name: should-fail
|
||||||
|
resourcetemplates:
|
||||||
|
- apiVersion: tekton.dev/v1beta1
|
||||||
|
kind: PipelineRun
|
||||||
|
metadata:
|
||||||
|
generateName: test-pipeline-
|
||||||
|
spec:
|
||||||
|
pipelineRef:
|
||||||
|
name: test-pipeline
|
||||||
|
params:
|
||||||
|
- name: should-fail
|
||||||
|
value: "$(tt.params.should-fail)"
|
||||||
|
workspaces:
|
||||||
|
- name: shared-data
|
||||||
|
volumeClaimTemplate:
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
- name: git-credentials
|
||||||
|
secret:
|
||||||
|
secretName: git-credentials
|
||||||
Loading…
Reference in New Issue