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://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.1.tar.gz (41.3 kB view hashes)

Uploaded Source

Built Distribution

pygitmon-0.0.1-py3-none-any.whl (29.3 kB view hashes)

Uploaded Python 3

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