-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathworkflow-git-input-artifact.yaml
50 lines (50 loc) · 1.69 KB
/
workflow-git-input-artifact.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: git-input-artifact
namespace: argo
spec:
entrypoint: git-clone
serviceAccountName: argo
arguments:
parameters:
- name: git-repo-path
value: "{{ tpl (required "value 'git.path' required" .Values.git.path) $ }}"
- name: git-repo-url
value: "{{ tpl (required "value 'git.repo' required" .Values.git.repo) $ }}"
- name: git-secret-name
value: "{{ tpl (required "value 'secretName' required" .Values.secretName) $ }}"
- name: git-repo-revision
value: "{{ tpl (required "value 'git.branch' required" .Values.git.branch) $ }}"
volumeClaimTemplates:
- metadata:
name: workdir
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
templates:
- name: git-clone
inputs:
artifacts:
- name: argo-source
path: '{{ printf "/gen-source{{workflow.parameters.git-repo-path}}" }}'
git:
repo: '{{ printf "https://{{workflow.parameters.git-repo-url}}" }}'
revision: '{{ printf "{{workflow.parameters.git-repo-revision}}" }}'
usernameSecret:
name: '{{ printf "{{workflow.parameters.git-secret-name}}" }}'
key: username
passwordSecret:
name: '{{ printf "{{workflow.parameters.git-secret-name}}" }}'
key: password
container:
image: alpine/git
command: [sh, -c]
args: ["git status && ls && cat README.md"]
workingDir: '{{ printf "/gen-source{{workflow.parameters.git-repo-path}}" }}'
volumeMounts:
- name: workdir
mountPath: /gen-source