Skip to main content

Monitor a git repository, execute a command when it changes. Basically a polling git-hook for pull.

Project description

Monitor a git repository, execute a command when it changes. Basically a polling git-hook for pull.

purpose

Execute a chain of command when a git-repository changes

use case

Run testsets and build docker container after commit [change detected] * Run a testset * Build a docker container * Push to registry

requirements

pip install -r requirements.txt

use

reposmon.py

Monitor a git repository, execute a command when it changes.

Usage:
    reposmon.py [options] [--] [<giturl> <command>]
    reposmon.py -h | --help

Options:
  -h --help                   Show this screen.
  -o --once                   Run only once.
  -v --verbose                Verbose mode.
  -w --write=<writeymlpath>   Write arguments yaml file.
  -l --load=<loadymlpath>     Load arguments yaml file.
  -i --interval=<interval>    Seconds between checks [default: 60].
  -g --gitfolder=<gitfolder>  Folder to check the git repos out [default: .].
  -c --cmdfolder=<cmdfolder>  Folder from where to run the command [default: .].

example

When in local directory or work-directory changes, execute the command in the local directory or command-directory.

python reposmon.py git@github.com:erikdejonge/reposmon.git "docker build ."

optional

bash alias

alias reposmon=”~/[…]/reposmon/reposmon.py

install alias with a workspace checkout of reposmon:

alias reposmon="/Users/rabshakeh/workspace/reposmon/reposmon.py"

commit and sort aliases on osx

On osx the sortalias command sorts all aliasses in .bash_profile

alias sortalias='cat ~/.bash_profile > ~/.bash_profile.backup; cat ~/.bash_profile | grep -v alias | grep -v '\''^$'\'' > ~/.bash_profile_without_alias; alias | grep -v '\''^$'\'' > ~/.bash_profile_only_alias; cat ~/.bash_profile_without_alias > ~/.bash_profile; echo -e '\''\n'\'' >>  ~/.bash_profile; cat ~/.bash_profile_only_alias >>  ~/.bash_profile; rm ~/.bash_profile_without_alias; rm ~/.bash_profile_only_alias'

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

reposmon-6.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file reposmon-6.tar.gz.

File metadata

  • Download URL: reposmon-6.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for reposmon-6.tar.gz
Algorithm Hash digest
SHA256 64f3cc754e995d90485fd85dee941a35fef4bea483334b5a4ef62c52ef6113f3
MD5 b369cc33932cf4d8a1aa71d03e1e931d
BLAKE2b-256 7621b515c06b6d8356b743237c067b39afe2acc8da4eca6e7d26c20fee717a97

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