github.com/argoproj/argo-cd/v2@v2.10.9/docs/user-guide/ci_automation.md (about)

     1  # Automation from CI Pipelines
     2  
     3  Argo CD follows the GitOps model of deployment, where desired configuration changes are first
     4  pushed to Git, and the cluster state then syncs to the desired state in git. This is a departure
     5  from imperative pipelines which do not traditionally use Git repositories to hold application
     6  config.
     7  
     8  To push new container images into to a cluster managed by Argo CD, the following workflow (or 
     9  variations), might be used:
    10  
    11  ## Build And Publish A New Container Image
    12  
    13  ```bash
    14  docker build -t mycompany/guestbook:v2.0 .
    15  docker push mycompany/guestbook:v2.0
    16  ```
    17  
    18  ## Update The Local Manifests Using Your Preferred Templating Tool, And Push The Changes To Git
    19  
    20  !!! tip
    21      The use of a different Git repository to hold your Kubernetes manifests (separate from
    22      your application source code), is highly recommended. See [best practices](best_practices.md)
    23      for further rationale.
    24  
    25  ```bash
    26  git clone https://github.com/mycompany/guestbook-config.git
    27  cd guestbook-config
    28  
    29  # kustomize
    30  kustomize edit set image mycompany/guestbook:v2.0
    31  
    32  # plain yaml
    33  kubectl patch --local -f config-deployment.yaml -p '{"spec":{"template":{"spec":{"containers":[{"name":"guestbook","image":"mycompany/guestbook:v2.0"}]}}}}' -o yaml
    34  
    35  git add . -m "Update guestbook to v2.0"
    36  git push
    37  ```
    38  
    39  ## Synchronize The App (Optional)
    40  
    41  For convenience, the argocd CLI can be downloaded directly from the API server. This is
    42  useful so that the CLI used in the CI pipeline is always kept in-sync and uses argocd binary
    43  that is always compatible with the Argo CD API server.
    44  
    45  ```bash
    46  export ARGOCD_SERVER=argocd.example.com
    47  export ARGOCD_AUTH_TOKEN=<JWT token generated from project>
    48  curl -sSL -o /usr/local/bin/argocd https://${ARGOCD_SERVER}/download/argocd-linux-amd64
    49  argocd app sync guestbook
    50  argocd app wait guestbook
    51  ```
    52  
    53  If [automated synchronization](auto_sync.md) is configured for the application, this step is
    54  unnecessary. The controller will automatically detect the new config (fast tracked using a
    55  [webhook](../operator-manual/webhook.md), or polled every 3 minutes), and automatically sync the new manifests.