Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stangirard/argocd-diff-finder
Script to find the diff between your latest commit and what is deployed via argocd
https://github.com/stangirard/argocd-diff-finder
argocd diff dyff finder helm kubernetes
Last synced: 3 months ago
JSON representation
Script to find the diff between your latest commit and what is deployed via argocd
- Host: GitHub
- URL: https://github.com/stangirard/argocd-diff-finder
- Owner: StanGirard
- License: apache-2.0
- Created: 2022-06-18T10:13:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-26T18:38:39.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T19:46:57.702Z (4 months ago)
- Topics: argocd, diff, dyff, finder, helm, kubernetes
- Language: Shell
- Homepage:
- Size: 511 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Argocd Diff Finder
**Argocd Diff Finder** is a small bash script that can tell you what your actual changes on your resources will be when you merge your changes to the ArgoCD repository.
## Why you need it
- It's **free**, easy and open source.
- It's easy to install
- No more pain knowing what your changes will be when you merge your changes to the ArgoCD repository.## Features
- It's a bash script :D (no need to install anything)
- None except telling you the differences between your changes and the state of your app in Kubernetes.## Demo
## How it works
Argocd Diff Finder works with two configurations:
- All your app declarations and their helm charts, yaml files are in the same repository (ARGOCD_GIT_URL)
- It scans your app declarations and their helm charts and yaml files and finds the differences between your changes and the state of your app in Kubernetes.
- You have a repository for your app declarations and point to another repository for your helm charts and yaml files.
- In this case, Argocd diff finder needs to be run on the repository that host your helm charts and yaml files.
- It will clone the argocd repository and then run the diff finder to find the path of all your apps.
- It will extract information in your app configurations in order to find the name of your argo apps that have been impacted by the changes in your branch
- It uses the `argocd app diff` command to find the differences between your changes and the state of your app in Kubernetes.## Installation
- Optional: Install dyff
- `brew install homeport/tap/dyff`
- `export KUBECTL_EXTERNAL_DIFF="dyff between -b "`
- Go to your branch with the changes you want to merge.
- Make sure you pushed your changes
- Make a port forward to your argocd server if it is not publicly accessible
- Export the following variables
```bash
export ARGOCD_SERVER= # The ArgoCD server address
export ARGOCD_USERNAME= # The ArgoCD username
export ARGOCD_PASSWORD= # The ArgoCD password
export ARGOCD_GIT_URL= # The ArgoCD git url with you applications configuration
```
- Optional: change some values
```bash
export MAIN_BRANCH= # The main branch of your application - default main
export ARGOCD_TMP_DIR= # The temporary directory to store the diffs - default /tmp/argocd-cd-tmp
```### Usage
- Run the script on your branch with the changes
```bash
bash argocd_diff_finder.sh #./argocd_diff_finder.sh
```#### Port Forwarding
- `-p`: Port forwarding to the ArgoCD server
- `ARGOCD_SERVER`: must be set to `localhost:8080`#### Run from anywhere
```bash
mkdir ~/bin
cd ~/bin
curl -sL https://raw.githubusercontent.com/StanGirard/argocd-diff-finder/main/argocd_diff_finder.sh > argo-diff
chmod +x argo-diff
``````bash
## Add to your path
export PATH=~/bin:$PATH
```## Contributions
Please feel free to add any contribution.
I might, if I have the time, translate it into go.## Disclaimers
It comes as is, without any warranty.