Last active
February 22, 2025 13:27
-
-
Save rampadc/eebf64847e1a05fb284458c96748f02e to your computer and use it in GitHub Desktop.
Tekton Pipeline Workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: tekton-pipeline- | |
namespace: default | |
spec: | |
entrypoint: pipeline-dag | |
serviceAccountName: pipeline | |
templates: | |
- name: pipeline-dag | |
dag: | |
tasks: | |
- name: apply-pipe1-pipeline | |
template: apply-resources | |
arguments: | |
parameters: | |
- name: url | |
value: https://raw.githubusercontent.com/rampadc/hi-deployer/main/pipeline.yaml | |
- name: pipe1 | |
template: pipe1 | |
dependencies: | |
- apply-pipe1-pipeline | |
- pre1 | |
- name: pipe2 | |
template: pipe2 | |
dependencies: | |
- apply-pipe1-pipeline | |
- pipe1 | |
- name: pre1 | |
template: pre1 | |
- name: post1 | |
template: post1 | |
dependencies: | |
- pipe2 | |
- name: apply-resources | |
inputs: | |
parameters: | |
- name: url | |
container: | |
image: quay.io/openshift/origin-cli:latest | |
command: | |
- /bin/bash | |
args: | |
- "-c" | |
- oc apply -f {{inputs.parameters.url}} | |
- name: pipe1 | |
resource: | |
action: create | |
manifest: | | |
apiVersion: tekton.dev/v1 | |
kind: PipelineRun | |
metadata: | |
generateName: pipe1-pr- | |
spec: | |
pipelineRef: | |
name: hi-deployer | |
params: | |
- name: name | |
value: pipe1 | |
successCondition: status.conditions.0.status == True | |
failureCondition: status.conditions.0.status == False | |
- name: pipe2 | |
resource: | |
action: create | |
manifest: | | |
apiVersion: tekton.dev/v1 | |
kind: PipelineRun | |
metadata: | |
generateName: pipe2-pr- | |
spec: | |
pipelineRef: | |
name: hi-deployer | |
params: | |
- name: name | |
value: pipe2 | |
successCondition: status.conditions.0.status == True | |
failureCondition: status.conditions.0.status == False | |
- name: pre1 | |
container: | |
image: quay.io/openshift/origin-cli:latest | |
command: | |
- /bin/bash | |
args: | |
- "-c" | |
- |- | |
oc get pods | |
oc get deploy | |
- name: post1 | |
container: | |
image: quay.io/openshift/origin-cli:latest | |
command: | |
- /bin/bash | |
args: | |
- "-c" | |
- |- | |
oc get pods | |
oc get deploy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment