octopilot

command module
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 14 Imported by: 0

README

Octopilot

Go Report Card Release Status Latest Release Go Reference

Octopilot is a CLI tool designed to help you automate your Gitops workflow, by automatically creating and merging GitHub Pull Requests to update specific content in Git repositories.

If you are doing Gitops with GitHub-hosted repositories, Octopilot is your swiss army knife to propagate changes in your infrastructure.

Octopilot was initially developed at Dailymotion, and is a core component of our Gitops workflow - you can read our blog post Introducing Octopilot: a CLI to automate the creation of GitHub pull requests in your gitops workflow.


Features

  • written in Go, and has 0 dependencies - not even git
  • native support for manipulating YAML or JSON files - which are commonly used in the Gitops world to describe resources
  • native support for manipulating files encrypted with sops - because who wants to store non-encrypted sensitive data in git?
  • supports regex-based updates to any kind of files - for these times when you need raw power
  • supports executing any command/tool - because you don't want to be limited by what we support
  • supports multiple strategies to create/update the PRs
  • supports automatic merge of the PRs - once the pre-configured CI checks are green
  • can update one or more GitHub repositories from a single execution - including dynamically defined repositories, using a GitHub search query
  • can execute one or more update rules in a single execution

Documentation


Example

Updating multiple repositories, and executing multiple update rules at once:

$ octopilot \
    --github-token "my-github-token" \
    --repo "my-org/some-repo" \
    --repo "my-org/another-repo(merge=true)" \
    --repo "discover-from(env=PROMOTE_TO_REPOSITORIES)" \
    --repo "discover-from(query=org:my-org topic:my-topic)" \
    --repo "discover-from(searchtype=code,query=org:my-org filename:my-file path:dir-path in-file-text)" \
    --repo "discover-from(searchtype=code,query=org:my-org filename:my-file path:dir-path fork:true)" \
    --update "yaml(file=config.yaml,path='version')=file(path=VERSION)" \
    --update "yq(file=helmfile.yaml,expression='(.releases[] | select(.chart == \"repo/my-chart\") | .version ) = strenv(VERSION)')" \
    --update "sops(file=secrets.yaml,key=path.to.base64encodedCertificateKey)=$(kubectl -n cert-manager get secrets tls-myapp -o template='{{index .data \"tls.key\"}}')" \
    --pr-title "Updating some files" \
    ...

Screenshots

Pull Request to promote a new release of an application

Including the release notes in the Pull Request description

Pull Request to update the certificates

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
git
Package git provides helper functions to work with Git repository - and mainly its configuration.
Package git provides helper functions to work with Git repository - and mainly its configuration.
parameters
Package parameters provides functions to work with "parameters": key-value maps.
Package parameters provides functions to work with "parameters": key-value maps.
yaml
Package yaml provides functions to work with YAML content
Package yaml provides functions to work with YAML content
Package repository contains everything related to working with git repositories hosted on GitHub: cloning, commits, creating branches, pushing, creating/updating/merging pull requests, and so on.
Package repository contains everything related to working with git repositories hosted on GitHub: cloning, commits, creating branches, pushing, creating/updating/merging pull requests, and so on.
Package update provides the updaters that change content in the git repositories
Package update provides the updaters that change content in the git repositories
exec
Package exec provides an updater that executes an external command to update the repository.
Package exec provides an updater that executes an external command to update the repository.
helm
Package helm provides an updater that updates Helm charts dependencies.
Package helm provides an updater that updates Helm charts dependencies.
regex
Package regex provides an updater that uses a regex to update files.
Package regex provides an updater that uses a regex to update files.
sops
Package sops provides an updater that uses the sops lib to update sops-encrypted files.
Package sops provides an updater that uses the sops lib to update sops-encrypted files.
value
Package value provides diffferent implementations to retrieve the value to replace while updating files.
Package value provides diffferent implementations to retrieve the value to replace while updating files.
yaml
Package yaml provides an updater that uses the yq lib to update YAML files.
Package yaml provides an updater that uses the yq lib to update YAML files.
yq
Package yq provides an updater that uses the yq lib to manipulate YAML (or JSON) files.
Package yq provides an updater that uses the yq lib to manipulate YAML (or JSON) files.

Jump to

Keyboard shortcuts

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