argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
15.11k stars 3.21k forks source link

docs: Add CI/CD example for building Argo Workflows using Argo Workflows - Fixes #8591 #13876

Closed wesleyscholl closed 1 week ago

wesleyscholl commented 2 weeks ago

A detailed example for implementing CI/CD pipelines to build Argo Workflows using Argo Workflows

Fixes #8591

Motivation

This issue was more than 2 years old and I wanted to contribute to the project. I also work with Argo Workflows everyday and I'm CAPA certified (Certified Argo Project Associate).

Modifications

WorkflowTemplate example includes:

CI

Description Resource Status
Argo Workflows API endpoint, submits WorkflowTemplate WorkflowEventBinding :ballot_box_with_check:
Build the CLI WorkflowTemplate :ballot_box_with_check:
Build images using Buildkit - Push images to Docker Hub WorkflowTemplate :ballot_box_with_check:
Run unit tests and collect test report WorkflowTemplate :ballot_box_with_check:
Run coverage and collect report WorkflowTemplate :ballot_box_with_check:
Deploy to a cluster WorkflowTemplate :ballot_box_with_check:
Run basic E2E tests and collect report WorkflowTemplate :ballot_box_with_check:

Pipeline

Description Resource Status
Combine CI and CD jobs with an approval step WorkflowTemplate :ballot_box_with_check:

CD

Description Resource Status
Tag and push tag WorkflowTemplate :ballot_box_with_check:
Update deployment manifests using kustomize edit set image WorkflowTemplate :ballot_box_with_check:
Commit deployment manifests WorkflowTemplate :ballot_box_with_check:
Start Argo CD sync step WorkflowTemplate :ballot_box_with_check:

Documentation & Configuration

Description Resource Status
CI, CD, & Pipeline Documentation Comments :ballot_box_with_check:
Service Account for WorkflowEventBinding ServiceAccount :ballot_box_with_check:
$ARGO_TOKEN - Bearer Authorization for WorkflowEventBinding Secret :ballot_box_with_check:
Role to submit workflow templates for WorkflowEventBinding Role :ballot_box_with_check:
RoleBinding the Role to the ServiceAccount for WorkflowEventBinding RoleBinding :ballot_box_with_check:
Docker configuration - Hub credentials Secret :ballot_box_with_check:
GitHub PAT - GitHub credentials Secret :ballot_box_with_check:
ArgoCD server and credentials Secret :ballot_box_with_check:
ArgoCD network policy NetworkPolicy :ballot_box_with_check:

Verification

Thoroughly tested the workflow: