1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-21 05:55:35 +00:00

Add a kamel-run test using multiple parameters

This commit is contained in:
Gaelle Fournier 2023-09-26 23:15:44 +02:00 committed by tekton-robot
parent 1093b2c468
commit ee409b2354
2 changed files with 132 additions and 54 deletions

View File

@ -8,3 +8,5 @@ tar -xvf camel-k-client-2.0.0-linux-amd64.tar.gz
# Add git-clone
add_task git-clone latest
add_task buildah latest
add_task maven latest

View File

@ -2,72 +2,148 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: kamel-run-test
name: kamel-run-basic-test
spec:
workspaces:
- name: shared-workspace
- name: shared-workspace
tasks:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-workspace
params:
- name: url
value: https://github.com/apache/camel-k-examples/
- name: kamel-run
taskRef:
name: kamel-run
runAfter:
- fetch-repository
workspaces:
- name: source
workspace: shared-workspace
params:
- name: filename
value: generic-examples/languages/routes.yaml
- name: wait
value: "false"
- name: verify-it-phase
runAfter:
- kamel-run
params:
- name: it-name
value: "$(tasks.kamel-run.results.integration-name)"
taskSpec:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-workspace
params:
- name: it-name
steps:
- name: bash
image: ubuntu
script: |
#!/usr/bin/env bash
set -e
- name: url
value: https://github.com/apache/camel-k-examples/
- name: kamel-run
taskRef:
name: kamel-run
runAfter:
- fetch-repository
workspaces:
- name: source
workspace: shared-workspace
params:
- name: filename
value: generic-examples/languages/routes.yaml
- name: wait
value: "false"
- name: verify-it-phase
runAfter:
- kamel-run
params:
- name: it-name
value: "$(tasks.kamel-run.results.integration-name)"
taskSpec:
params:
- name: it-name
steps:
- name: bash
image: ubuntu
script: |
#!/usr/bin/env bash
set -e
if [ "$(params.it-name)" != "routes" ]; then
echo "Expected integration name routes (was $(params.it-name))"
exit 1
fi
exit 0
if [ "$(params.it-name)" != "routes" ]; then
echo "Expected integration name routes (was $(params.it-name))"
exit 1
fi
exit 0
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: kamel-run-test-run
name: kamel-run-basic-test-run
spec:
pipelineRef:
name: kamel-run-test
name: kamel-run-basic-test
taskRunSpecs:
- pipelineTaskName: kamel-run
taskServiceAccountName: camel-k-tekton
workspaces:
- name: shared-workspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
- name: shared-workspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: kamel-run-image-test
spec:
workspaces:
- name: shared-workspace
tasks:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-workspace
params:
- name: url
value: https://github.com/apache/camel-k-examples/
- name: kamel-run
taskRef:
name: kamel-run
runAfter:
- fetch-repository
workspaces:
- name: source
workspace: shared-workspace
params:
- name: filename
value: generic-examples/languages/routes.yaml
- name: wait
value: "false"
- name: container-image
value: docker.io/apache/camel-k:2.0.0
- name: verify-it-phase
runAfter:
- kamel-run
params:
- name: it-name
value: "$(tasks.kamel-run.results.integration-name)"
taskSpec:
params:
- name: it-name
steps:
- name: bash
image: ubuntu
script: |
#!/usr/bin/env bash
set -e
if [ "$(params.it-name)" != "routes" ]; then
echo "Expected integration name routes (was $(params.it-name))"
exit 1
fi
exit 0
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: kamel-run-image-test-run
spec:
pipelineRef:
name: kamel-run-image-test
taskRunSpecs:
- pipelineTaskName: kamel-run
taskServiceAccountName: camel-k-tekton
workspaces:
- name: shared-workspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi