Skip to main content

Run command when the upstream git branch was updated.

Example work file named git-monitor.yaml:

  • path: ~/work/company-website-dev
    command: ansible-playbook playbook-develop-company.yml
  • path: ~/work/company-website-prod
    remote: origin
    branch: production
    force: 1
    commands:
    - ansible-playbook playbook-deploy-company.yml

The first item ignores the default values, which are remote=origin, branch=main, force=0. If you didn’t set command, gitmon will only update the repository.

In the next example we have three additional fields:

  • path: ~/work/company-website-prod
    remote: origin
    branch: main
    force: 1
    repo_url: git@github.com:username/company-website
    ssh_keyfile: ~/.ssh/company-key
    ssh_keyfile_password: company-password

If the path is empty, we will try to create a new clone. And if the url scheme is not http, we will assume it was ssh, and if ssh_keyfile is set we will use that when cloning or updating the path.

Usage

Example:

python3 -m gitmon git-monitor.yaml

Release files for pygitmon 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygitmon 0.0.2
File Size Uploaded
pygitmon-0.0.2.tar.gz 41.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygitmon 0.0.2
File Interpreter ABI Platform
pygitmon-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 70.6 kB

Release files / pygitmon-0.0.2.tar.gz

Download URL pygitmon-0.0.2.tar.gz
Size 41.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9785c47fc89de7ff23e2c379f224a23a0599408f960331bff1fd503286be42f7
BLAKE2b-256 checksum
How to use checksums
290e03fe60d51e0f8a88ed25f13d1976fa1aa5495001f1651ef45765280cd5b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / pygitmon-0.0.2-py3-none-any.whl

Download URL pygitmon-0.0.2-py3-none-any.whl
Size 29.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
719a7556ef0fa62c40ff5872e465fffcb96d817189161ef4257b29b35255750d
BLAKE2b-256 checksum
How to use checksums
13043e47ad98227b146560f00174b5e47f31bf888e6dae97c22a4fc39bbd9c46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page