fibonacci_pipeline/argo-workflows/ci-workflow-using-clusterWorkflowTemplates.yaml

79 lines
2.5 KiB
YAML
Raw Normal View History

2024-11-08 11:37:54 +00:00
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: ci-workflow-using-cluster-templates-
namespace: argo
labels:
workflows.argoproj.io/archive-strategy: "false"
annotations:
workflows.argoproj.io/description: |
This is a simple ci workflow that utilizes ClusterWorkflowTemplates.
spec:
entrypoint: ci
serviceAccountName: admin
volumeClaimTemplates:
- metadata:
name: shared-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
volumes:
- name: docker-config
secret:
secretName: my-docker-secret
templates:
- name: ci
dag:
tasks:
- name: git-clone
templateRef:
name: git-clone-template
template: git-clone
clusterScope: true
arguments:
parameters:
- name: git-repo
value: "https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/Franz.Germann/fibonacci_go.git"
- name: unit-tests
templateRef:
name: unit-tests-template
template: unit-tests
clusterScope: true
dependencies: [git-clone]
- name: lint-scan
templateRef:
name: lint-scan-template
template: lint-scan
clusterScope: true
dependencies: [git-clone]
- name: build
templateRef:
name: build-and-push-image-template
template: build
clusterScope: true
arguments:
parameters:
- name: dockerfile-name
value: "Dockerfile"
- name: image-destination
value: "gitea.cnoe.localtest.me/giteaadmin/fibonacci_go:latest"
dependencies: [unit-tests, lint-scan]
- name: trivy-filesystem-scan
templateRef:
name: trivy-filesystem-scan-template
template: trivy-filesystem-scan
clusterScope: true
dependencies: [git-clone]
- name: trivy-image-scan
templateRef:
name: trivy-image-scan-template
template: trivy-image-scan
clusterScope: true
arguments:
parameters:
- name: image
value: "gitea.cnoe.localtest.me/giteaadmin/fibonacci_go:latest"
dependencies: [build]