Skip to content

Commit 888220a

Browse files
starter-manual-sync 0.0.2 add annotations (#547)
1 parent 5f5c202 commit 888220a

File tree

5 files changed

+202
-0
lines changed

5 files changed

+202
-0
lines changed

examples/starter-manual-sync/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
4+
## v0.0.2 (18.08.2024)
5+
6+
### starter-manual-sync
7+
8+
Add annotations to the workflow
9+
10+
311
## v0.0.1 (27.12.2023)
412

513
### starter-manual-sync
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# starter manual sync
2+
3+
## Summary
4+
5+
This Workflow Template is an example for post promotion workflow that sync, wait and send a slack message once the app is synced
6+
## Templates
7+
8+
1. [starter-manual-sync](https://github.com/codefresh-io/argo-hub/blob/main/examples/starter-manual-sync/versions/0.0.1/docs/starter-manual-sync.md)
9+
10+
## Security
11+
12+
Minimal required permissions
13+
14+
[Full rbac permissions list](https://github.com/codefresh-io/argo-hub/blob/main/examples/starter-manual-sync/versions/0.0.1/rbac.yaml)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Starter manual sync
2+
3+
## Summary
4+
5+
This Workflow Template is an example for post promotion workflow that:
6+
- Sync an application in ArgoCD. See `argocd app sync --help` with the ArgoCD CLI for flags
7+
- Wait for an application in ArgoCD. See `argocd app wait --help` with the ArgoCD CLI for flags
8+
- send messages to a Slack channel using a webhook URL.
9+
10+
11+
## Inputs/Outputs
12+
13+
#### Parameters
14+
* APP_NAME (required)- The app to sync (if syncing by label, use flags).
15+
* APP_NAMESPACE - The app namespace.
16+
* SERVER_URL (required) - The address to reach ArgoCD
17+
(if in cluster, something like `argocd-server.<namespace>.svc.cluster.local` for cli based; `argo-cd-server.<namespace>.svc.cluster.local` for helm based.
18+
It's important to note that users have the flexibility to customize and modify these designations based on their specific preferences or requirements.)
19+
20+
### Outputs
21+
no outputs
22+
23+
## Examples
24+
25+
### task Example
26+
```
27+
apiVersion: argoproj.io/v1alpha1
28+
kind: Workflow
29+
metadata:
30+
generateName: starter-manual-sync-
31+
spec:
32+
entrypoint: main
33+
volumes:
34+
templates:
35+
- name: main
36+
dag:
37+
tasks:
38+
- name: starter-manual-sync
39+
templateRef:
40+
name: argo-hub.starter-manual-sync.0.0.2
41+
template: starter-manual-sync
42+
arguments:
43+
parameters:
44+
- name: APP_NAME
45+
value: 'my-app'
46+
- name: APP_NAMESPACE
47+
value: 'staging'
48+
- name: SERVER_URL
49+
value: 'argo-cd-server.staging.svc.cluster.local'
50+
```
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: argo-hub.starter-manual-sync.0.0.2
5+
annotations:
6+
argo-hub/version: '0.0.2'
7+
---
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: Role
10+
metadata:
11+
name: argo-hub.starter-manual-sync.0.0.2
12+
annotations:
13+
argo-hub/version: '0.0.2'
14+
rules:
15+
- apiGroups:
16+
- ""
17+
resources:
18+
- pods
19+
verbs:
20+
- get
21+
- watch
22+
- patch
23+
- apiGroups:
24+
- ""
25+
resources:
26+
- pods/log
27+
verbs:
28+
- get
29+
- watch
30+
---
31+
apiVersion: rbac.authorization.k8s.io/v1
32+
kind: RoleBinding
33+
metadata:
34+
name: argo-hub.starter-manual-sync.0.0.2
35+
annotations:
36+
argo-hub/version: '0.0.2'
37+
roleRef:
38+
apiGroup: rbac.authorization.k8s.io
39+
kind: Role
40+
name: argo-hub.starter-manual-sync.0.0.2
41+
subjects:
42+
- kind: ServiceAccount
43+
name: argo-hub.starter-manual-sync.0.0.2
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: WorkflowTemplate
3+
metadata:
4+
name: argo-hub.starter-manual-sync.0.0.2
5+
annotations:
6+
version: 0.0.1
7+
codefresh.io/workflow-origin: promotion
8+
argo-hub/version: '0.0.1'
9+
argo-hub/description: 'This Workflow Template is an example for post promotion workflow that sync, wait and send a slack message once the app is synced'
10+
argo-hub/categories: 'promotion example workflow'
11+
argo-hub/license: 'MIT'
12+
argo-hub/owner_name: 'Eti Zaguri'
13+
argo-hub/owner_email: '[email protected]'
14+
argo-hub/owner_avatar: 'https://avatars.githubusercontent.com/u/85868206'
15+
argo-hub/owner_url: 'https://github.com/eti-codefresh'
16+
argo-hub/icon_url: "https://cdn.jsdelivr.net/gh/codefresh-io/argo-hub@main/examples/starter-manual-sync/assets/icon.svg"
17+
argo-hub/icon_background: "#f4f4f4"
18+
spec:
19+
arguments:
20+
parameters:
21+
# These values are injected by the gitops controller .
22+
- name: APP_NAME
23+
- name: APP_NAMESPACE
24+
- name: SERVER_URL
25+
value: 'argo-cd-server.{{workflow.parameters.APP_NAMESPACE}}.svc.cluster.local'
26+
entrypoint: starter-manual-sync
27+
templates:
28+
- name: starter-manual-sync
29+
metadata:
30+
annotations:
31+
argo-hub-template/description: 'Sync, wait and send a slack message once the app is synced'
32+
argo-hub-template/icon_url: "https://cdn.jsdelivr.net/gh/codefresh-io/argo-hub@main/examples/starter-manual-sync/assets/icon.svg"
33+
argo-hub-template/icon_background: "#f4f4f4"
34+
dag:
35+
tasks:
36+
- name: sync
37+
templateRef:
38+
name: argo-hub.argocd.0.0.1
39+
template: sync
40+
arguments:
41+
parameters:
42+
- name: app
43+
value: '{{workflow.parameters.APP_NAME}}'
44+
- name: flags
45+
value: '--prune --timeout 120'
46+
# For example: `argocd-server.<namespace>.svc.cluster.local` for cli based; `argo-cd-server.<namespace>.svc.cluster.local` for helm based.
47+
- name: serverUrl
48+
value: '{{workflow.parameters.SERVER_URL}}'
49+
- name: opts
50+
value: '--grpc-web --plaintext'
51+
- name: tokenSecret
52+
value: 'argocd-token'
53+
- name: tokenSecretKey
54+
value: 'token'
55+
- name: wait
56+
templateRef:
57+
name: argo-hub.argocd.0.0.1
58+
template: wait
59+
arguments:
60+
parameters:
61+
- name: app
62+
value: '{{workflow.parameters.APP_NAME}}'
63+
- name: flags
64+
value: '--health --timeout 120'
65+
- name: serverUrl
66+
# For example: `argocd-server.<namespace>.svc.cluster.local` for cli based; `argo-cd-server.<namespace>.svc.cluster.local` for helm based.
67+
value: '{{workflow.parameters.SERVER_URL}}'
68+
- name: opts
69+
value: '--grpc-web --plaintext'
70+
- name: tokenSecret
71+
value: 'argocd-token'
72+
- name: tokenSecretKey
73+
value: 'token'
74+
depends: sync
75+
- name: send-message
76+
templateRef:
77+
name: argo-hub.slack.0.0.2
78+
template: send-message
79+
arguments:
80+
parameters:
81+
- name: SLACK_HOOK_URL
82+
# Please enter your Slack webhook URL here.
83+
value: '<SLACK_HOOK_URL>'
84+
- name: SLACK_TEXT
85+
value: 'Successfully promoted {{workflow.parameters.APP_NAME}}!'
86+
depends: wait
87+

0 commit comments

Comments
 (0)