goff

command module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

ci

GOFF

Inspired from Kostis Kapelonis (Codefresh.io) talk at the KubeCon about How to Preview and Diff Your Argo CD Deployments we relased our own GitOps Diff tool (Goff). This tool helps you to preview your changes in your GitOps Repository.

How it works

Checkout the examples

Kustomize example

Example for Kustomization diff

#Build base and all overlays from source branch
goff kustomize build ./source/kustomize --output-dir /tmp/source/out
#Build base and all overlays from target branch
goff kustomize build ./target/kustomize --output-dir /tmp/target/out
#Diff rendered manifests
goff diff "/tmp/source" "/tmp/target" --title=Preview --output-dir .
  1. Create a new branch and commit your changes in your Kustomize deployment GitHub Diff
  2. Run your pipeline, Goff renders the Base and the Overlays and calculate the diff between the source and target branch.
  3. Check the auto generated comment in your Pull request and review the changes GitHub Diff
ArgoCD Application

Example for ArgoCD Application diff

#Render all ArgoCD manifests in directory from source branch
goff argocd app "./source/argocd" --repo-server="repo-server:8081" --output-dir=/tmp/source/
#Render all ArgoCD manifests in directory from target branch
goff argocd app "./target/argocd" --repo-server="repo-server:8081" --output-dir=/tmp/target/
#Diff rendered Kubernetes manifests
goff diff "/tmp/source" "/tmp/target" --output-dir .
  1. Create a new branch and commit your changes in your ArgoCd Application GitHub Diff
  2. Run your pipeline, Goff renders the Appication into manifests calculate the diff between the source and target branch.
  3. Check the auto generated comment in your Pull request and review the changes GitHub Diff

Usage

GitOps Diff Tool

Usage:
  goff [command]

Available Commands:
  argocd      Render manifests from ArgoCD resources
  completion  Generate the autocompletion script for the specified shell
  diff        Diff files [sourceDir] [targetDir]
  help        Help about any command
  kustomize   Generate a DOT file to visualize the dependencies between your kustomize components
  split       Split manifests [manifestFile]

Flags:
  -h, --help              help for goff
  -l, --logLevel string   Set loglevel [debug, info, error] (default "error")

Use "goff [command] --help" for more information about a command.

Supported Tools

Tooling Support
Plain manifests
Helm ✅ Supported through plain manifests
Kustomize
ArgoCD Application ✅ Needs a local ArgoCD Repo server instance
ArgoCD ApplicationSet 🚧 Not yet fully supported (List generators only)

Build

Build binary from source
go build -o goff goff 
Build Image with dagger
export REGISTRY_PASSWORD=....
export REGISTRY_USER=....
go run ci/main.go 

If you wanna try the new fancy Dagger TUI

export _EXPERIMENTAL_DAGGER_TUI=1
export REGISTRY_PASSWORD=....
export REGISTRY_USER=....
dagger run go run ci/main.go

Documentation

Overview

Copyright © 2023 Ch. Schlatter schlatter@puzzle.ch

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL