Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
64.4K

gitops-argocd-sync gitops-argocd-sync

Syncs Argo CD apps managed by our GitOps Runtimes

arguments

  • APPLICATION - The name of the Argo CD Application to be synced
  • APP_NAMESPACE - The namespace of the Argo CD Application to be synced
  • CA_BUNDLE - OPTIONAL - a base64 encoded string that contain the complete CA Certificate Bundle
  • IMAGE_NAME - OPTIONAL - To overwrite the image name to use
  • IMAGE_TAG - OPTIONAL - To overwrite the tag to use
  • INSECURE - OPTIONAL - to allow the usage of a self-signed certificate in the chain to reach the API endpoint
  • INTERVAL - OPTIONAL - Interval in seconds to wait between checks
  • LOG_LEVEL - OPTIONAL - set the log level, e.g. 'debug', 'info', 'warn', 'error', 'critical' (default 'error')
  • MAX_CHECKS - OPTIONAL - Maximum numbers of checks to do (to avoid forever wait). Default is 10.
  • ROLLBACK - OPTIONAL - Initiate a rollback to the previous revision if the Sync and Wait does not become healthy
  • RUNTIME - The name of the GitOps Runtime managing the Argo CD Application
  • WAIT_HEALTHY - OPTIONAL - Wait for the app to be healthy
  • WAIT_ROLLBACK - OPTIONAL - Wait for the app to be healthy after a rollback. Forces ROLLBACK to true

returns

  • HEALTH_STATUS - The health status of the application: HEALTHY, PROGRESSING, DEGRADED or SUSPENDED
  • ROLLBACK_EXECUTED - A flag to indicate if a rollback was executed or not
    sync_argo_cd_app:
  title: Sync Argo CD app
  type: gitops-argocd-sync
  arguments:
    RUNTIME: my-runtime
    APPLICATION: my-app

  
    sync_argo_cd_app:
  title: Sync Argo CD app
  type: gitops-argocd-sync
  arguments:
    RUNTIME: my-runtime
    APPLICATION: my-app
    WAIT_HEALTHY: true
    INTERVAL: 30
    MAX_CHECKS: 5

  
    sync_argo_cd_app:
  title: Sync Argo CD app
  type: gitops-argocd-sync
  arguments:
    RUNTIME: my-runtime
    APPLICATION: my-app
    APP_NAMESPACE: my-app-ns
    WAIT_HEALTHY: true
    INTERVAL: 60
    MAX_CHECKS: 3
    ROLLBACK: true
    LOG_LEVEL: debug

  
github.com
Francisco Cocozza
Feb 25, 2025