Skip to main content

Update git working directory and run commands

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygitmon-0.0.2.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

pygitmon-0.0.2-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file pygitmon-0.0.2.tar.gz.

File metadata

  • Download URL: pygitmon-0.0.2.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pygitmon-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9785c47fc89de7ff23e2c379f224a23a0599408f960331bff1fd503286be42f7
MD5 853064d613e76fbb431f474718631964
BLAKE2b-256 290e03fe60d51e0f8a88ed25f13d1976fa1aa5495001f1651ef45765280cd5b7

See more details on using hashes here.

File details

Details for the file pygitmon-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pygitmon-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pygitmon-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 719a7556ef0fa62c40ff5872e465fffcb96d817189161ef4257b29b35255750d
MD5 3c9d1ee611f0a9f9fe1595c316e99276
BLAKE2b-256 13043e47ad98227b146560f00174b5e47f31bf888e6dae97c22a4fc39bbd9c46

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page