Watchtower for Git: automatically keep local Git repositories up to date with their remotes

CrowsNest

MainCI ReleaseCI Docker Pulls Go Report Card buymeacoffee donate link

Watchtower for Git: automatically keep local Git repositories up to date with their remotes.

Configuration

Flags

--run-once or -r: Normally CrowsNest would loop forever, set this flag to run once then exit

--config or -c: Where to look for your config.yaml file (. and $HOME are automatically searched)

--verbose or -v: Write a lot more info to the log, useful for finding errors

--logfile or -l: Write the log to the given file instead of stdout. Should be a full path ending with the file name

config.yaml

CrowsNest reads its configuration from a config.yaml file.

Example config.yaml using every possible option:

# The list of repositories we want to watch
repositories:
  # The name of this repsoitory (can be anything, will show up in logs)
  peicecost:
    # The path to the root of the repo
    directory: D:\Code\piececost
    # Extra flags to provide to git when CrowsNest runs `git pull`
    gitpullflags: ["--verbose", "--autostash"]
    # How long to wait between pulls in seconds (defaults to 60), doesn't account for the time it takes to run cmds and pull
    interval: 900
    # A command to run before pulling, if this returns a non-zero exit code, the pull will not happen
    prepullcmd:
      # The binary to execute, e.g. /bin/bash on debian for a shell script
      binarypath: C:\Programs\dosomething.exe
      # Any flags/arguments for the binary
      flags: ["--user", "psidex"]
      # Where to execute this binary
      workingdirectory: D:\Code\piececost\otherdir
    # A command to be run after pulling, same options as prepullcmd, but a non-zero exit code won't change anything
    postpullcmd:
      binarypath: C:\Programs\dosomething.exe
      flags: ["--user", "psidex"]
      workingdirectory: D:\Code\piececost\otherdir

The only required option is the directory for each repo, and if you have set pre/post cmds then the binarypath and workingdirectory need to be valid for each of those.

Keep in mind that if you are running CrowsNest in a Docker container, all of the set directories and the pre and post pull binaries will need to be available and exectuable inside the container.

Docker

If you want to try it out in Docker there are images available on Docker Hub.

2 builds are published, latest which is inline with the latest commit to this repository, and the versioned tags that are inline with the GitHub releases.

Example Docker Run

The crowsnest binary exists in and is run from the /app directory in the container.

I chose /gitrepos/Apollo in this example for no reason other than its short and descriptive, docker will create that directory automatically.

docker run -d --name crowsnest --restart unless-stopped \
    -v $(pwd)/config.yaml:/app/config.yaml:ro \
    -v /home/psidex/repos/Apollo:/gitrepos/Apollo \
    psidex/crowsnest:latest

My config.yaml:

repositories:
  apollo:
    directory: /gitrepos/Apollo

Notice that the directory is the path inside the container, not the external path.

Use Cases

This would be useful if you store configuration files or content in a Git repository and want to keep your local copies up to date with the most recent versions.

Personally I use this to keep my website up to date as the files are published to GitHub from my development machine but need to be on my server to be served to the internet.

Bugs And Feature Requests

If you find a bug or would like to request a new feature please open an Issue.

Development

Requires govvv to build correctly.

See build.ps1 or the Dockerfile for build commands.

Similar Resources

To copy a secret to another namespace and sync it up-to-date

Secret Mirror Operator This kubebuilder-based Kubernetes operator copies a Secret to another namespace and synchronizes it with the custom resource Se

Jul 20, 2022

Output all versions of a local git repo, which could be used as test data for your ML program.

gitwalker Output all versions of a local git repo, which could be used as test data for your ML program. Notice This program is under development. Cur

Dec 27, 2021

Git with a cup of tea, painless self-hosted git service

Git with a cup of tea, painless self-hosted git service

Gitea - Git with a cup of tea View the chinese version of this document Purpose The goal of this project is to make the easiest, fastest, and most pai

Jan 2, 2023

pr-bullet is a tool for copying pull request to multiple repositories.

pr-bullet pr-bullet is a tool for copying pull request to multiple repositories. Usage First, create original pull request ( ex. https://github.com/k1

Oct 5, 2022

ghfs implements the io/fs interfaces for GitHub remote repositories.

ghfs implements the io/fs interfaces for GitHub remote repositories.

Nov 9, 2022

Go module for interacting with public ECR repositories

go-publicecr go-publicecr is a module for listing ECR image tags on a public ECR repository. Why go-publicecr The official Go SDK does not support int

Nov 24, 2021

Gh-s - Search github repositories interactively

Gh-s - Search github repositories interactively

search github repositories interactively Installation • Usage • Feedback Search

Dec 7, 2022

ControllerMesh is a solution that helps developers manage their controllers/operators better.

ControllerMesh is a solution that helps developers manage their controllers/operators better.

ControllerMesh ControllerMesh is a solution that helps developers manage their controllers/operators better. Key Features Canary update: the controlle

Jan 6, 2023

The GCP Enterprise Cloud Cost Optimiser, or gecco for short, helps teams optimise their cloud project costs.

The GCP Enterprise Cloud Cost Optimiser, or gecco for short, helps teams optimise their cloud project costs.

gecco helps teams optimise their cloud resource costs. Locate abandoned, idle, and inefficiently configured resources quickly. gecco helps teams build

Jan 9, 2022
Comments
  • [ REQUEST] Different Branches

    [ REQUEST] Different Branches

    I run different branches for my project

    master and dev ( for testing) is it possible to add a flag in to the config.yml to switch between the branches?

Automatically create global & local Rate Limit in Istio, support EnvoyFilter versioning!

istio-ratelimit-operator Istio ratelimit operator provide an easy way to configure Global or Local Ratelimit in Istio mesh. Istio ratelimit operator a

Oct 24, 2022
A Simple and Comprehensive Vulnerability Scanner for Container Images, Git Repositories and Filesystems. Suitable for CI
A Simple and Comprehensive Vulnerability Scanner for Container Images, Git Repositories and Filesystems. Suitable for CI

A Simple and Comprehensive Vulnerability Scanner for Containers and other Artifacts, Suitable for CI. Table of Contents Abstract Features Installation

Jan 1, 2023
Hassle-free minimal CI/CD for git repositories with docker or docker-compose projects.
Hassle-free minimal CI/CD for git repositories with docker or docker-compose projects.

GIT-PIPE Hassle-free minimal CI/CD for git repos for docker-based projects. Features: zero configuration for repos by default automatic encrypted back

Sep 23, 2022
Git-auto-push - Auto commit and push to github repositories

Auto commit and push to github repositories. How to use git clone https://github

Dec 19, 2022
Local Storage is one of HwameiStor components. It will provision the local LVM volume.
Local Storage is one of HwameiStor components. It will provision the local LVM volume.

Local Storage Module English | Simplified_Chinese Introduction Local Storage is one of modules of HwameiStor which is a cloud native local storage sys

Aug 6, 2022
A simple program to automatically backup a database using git. Err handling by Sentry, Reporting by Betteruptime. Made with 🩸 , 😓 & 😭

backup What is this? A Simple program to automatically backup a database using git. Err handling by Sentry, Uses heartbeats by Betteruptime Made with

Nov 4, 2022
grafana-sync Keep your grafana dashboards in sync.

grafana-sync Keep your grafana dashboards in sync. Table of Contents grafana-sync Table of Contents Installing Getting Started Pull Save all dashboard

Dec 14, 2022
Keep updated about all deploys on Tsuru

Snitch Keep updated about each deploy via Tsuru. This program will notify your team and many tools when someone has deployed any application via Tsuru

Sep 27, 2022
Duwant2keepyourperks - Du want 2 keep your perks

duwant2keepyourperks DU want to keep your perks? Installation Download the lates

Jan 10, 2022
Sapfun - Utility that takes control over your video card coolers to keep it cool and steady

What? sapfun - Utility that takes control over your video card coolers to keep i

Feb 18, 2022