Skip to content

Commit f791145

Browse files
authored
chore(examples): add argo-workflows example (#18)
* chore(examples): add argo-workflows example * Update argo-workflows-template.yaml * Update argo-workflows-template.yaml
1 parent eec1388 commit f791145

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
apiVersion: argoproj.io/v1alpha1
3+
kind: WorkflowTemplate
4+
metadata:
5+
name: github-notifier
6+
spec:
7+
entrypoint: generic-github-notifier
8+
templates:
9+
- name: generic-github-notifier
10+
inputs:
11+
parameters:
12+
- name: organization
13+
- name: repository
14+
- name: revision
15+
- name: context
16+
value: 'argo-workflows'
17+
- name: state
18+
- name: target_url
19+
- name: description
20+
container:
21+
image: cloudposse/github-status-updater:0.5.0
22+
env:
23+
- name: GITHUB_ACTION
24+
value: 'update_state'
25+
- name: GITHUB_STATE
26+
value: '{{inputs.parameters.state}}'
27+
- name: GITHUB_TARGET_URL
28+
value: '{{inputs.parameters.target_url}}'
29+
- name: GITHUB_DESCRIPTION
30+
value: '{{inputs.parameters.description}}'
31+
- name: GITHUB_CONTEXT
32+
value: '{{inputs.parameters.context}}'
33+
- name: GITHUB_TOKEN
34+
valueFrom:
35+
secretKeyRef:
36+
key: 'github-automation-token'
37+
name: 'github-automation-secret'
38+
- name: GITHUB_OWNER
39+
value: '{{inputs.parameters.organization}}'
40+
- name: GITHUB_REPO
41+
value: '{{inputs.parameters.repository}}'
42+
- name: GITHUB_REF
43+
value: '{{inputs.parameters.revision}}'
44+
- name: GITHUB_BASE_URL
45+
value: https://private-github-instance/api/v3/
46+
- name: GITHUB_UPLOAD_URL
47+
value: https://private-github-instance/api/uploads
48+
- name: GITHUB_INSECURE
49+
value: 'false'
50+
resources:
51+
requests:
52+
cpu: 1m
53+
memory: 8Mi
54+
activeDeadlineSeconds: 300
55+
56+
---
57+
apiVersion: argoproj.io/v1alpha1
58+
kind: WorkflowTemplate
59+
metadata:
60+
name: build-template
61+
spec:
62+
arguments:
63+
parameters:
64+
- name: revision
65+
value: master
66+
entrypoint: main
67+
templates:
68+
- name: main
69+
dag:
70+
tasks:
71+
- name: notify-github-pending
72+
templateRef:
73+
name: github-notifier
74+
template: generic-github-notifier
75+
arguments:
76+
parameters:
77+
- name: repository
78+
value: 'my-repo'
79+
- name: revision
80+
value: '{{workflow.parameters.revision}}'
81+
- name: state
82+
value: 'pending'
83+
- name: target_url
84+
value: 'https://argo-workflows.example.com/workflows/{{workflow.namespace}}/{{workflow.name}}'
85+
- name: description
86+
value: 'pending'
87+
- name: organisation
88+
value: 'my-org'
89+
90+
- name: build-task
91+
template: build-task
92+
93+
- name: notify-github-result
94+
templateRef:
95+
name: github-notifier
96+
template: generic-github-notifier
97+
arguments:
98+
parameters:
99+
- name: repository
100+
value: 'my-repo'
101+
- name: revision
102+
value: '{{workflow.parameters.revision}}'
103+
- name: state
104+
value: "{{= tasks['build-task'].status == 'Succeeded' ? 'success' : 'failure'}}"
105+
- name: target_url
106+
value: 'https://argo-workflows.example.com/workflows/{{workflow.namespace}}/{{workflow.name}}'
107+
- name: description
108+
value: "{{= tasks['build-task'].status == 'Succeeded' ? 'build succeed' : 'build failed'}}"
109+
- name: organisation
110+
value: 'my-org'
111+
depends: build-task || build-task.Failed
112+
113+
- name: build-task
114+
# implement your build task here

0 commit comments

Comments
 (0)