Package: grony
gronyAn utility to schedule git-related actions (pull,commitandpushat this moment) using crontab expressions.InstallationNote: you need Python 3.>pipinstallgronyAfter that, should have agronycommand available.>gronyUsagegronyconsists of two components:A long running process (the scheduler) used to schedule and launch git commands.A client, used to manage the scheduler.First things first. You need to start the scheduler.Starting the schedulerUsing whatever method you want (in a console, a startup script o anything supported in your OS) run:>gronystartThe tool will run in foreground. So it's advised yo use a way to leave it as a background process.Starting the scheduler as a service in LinuxTBD.Starting the scheduler as a service in macOSUse the scripts located atscripts/macOSin this repo to add/remove a launchd for grony.To enable the grony scheduler as a service and start automatically when the current user logs in.>scripts/macOS/add-launchd.shTo prevent the grony scheduler to start automatically when the current user logs in.>scripts/macOS/remove-launchd.shAdd a repositorySay you want to execute an automatic commit on a repository located at/sources/my-project.>gronyadd/sources/my-project
Repositoryfriendlyname[my-project]:<pressenter>
Successfullyaddedmy-projectThat's it. That command instructs grony to schedule tasks for that repository. No to the next ste.Configure actionsYou need a way to tell grony what commands to run and when. Depending of your needs or personal preferences, you can use two ways:A centralized one, configured in (whichever is found first):$GRONY_CONFIG_PATH$XDG_CONFIG_HOME/.grony/grony.conf$HOME/.grony/grony.conf.A decentralized one, configured in each repo's.gronyfile.Configuring actions ingrony.confOpen yourgrony.confin a text editor. You should see something like this (you can ignore any value in the[config]section as it's used internally by the program)[config]ipc_port=62830secret=4ac19f9d-7e18-4a0e-aa83-729c51bdddcf[repo 'my-project']path=/sources/my-projectYou must setup what to do inmy-projectin the section[repo 'my-project'].Available options are:pull-on: a crontab-like expression detailing when to rungit pull.pull-remote: the remote name where to pull from (optional)commit-on: a crontab-like expression detailing when to rungit add -A && git commit.commit-message: the commit message forcommit-on(defaults to 'Auto commit at %Y%m%d %H:%M:%S').push-on: : a crontab-like expression detailing when to rungit push.push-remote: the remote name where to push to (optional)You don't have to set all values. Only those what you need. For example, if you only need to perform automatic commits every minute and you are ok with the default message, configurecommit-onlike this:[repo 'my-project']path=/sources/my-projectcommit-on=* * * * *You can configure all actions if you want. Remember that if they need to run at the same time, they'll run always in the this order:pull-on,commit-on,push-on.[repo 'my-project']path=/sources/my-projectpush-on=@hourly; the config order you use does not matterpull-on=@hourlycommit-on=@hourlyConfiguring actions in each repo's.gronyYou can put a.gronyfile in the repository root with the following format:[repo]push-on=@hourlypull-on=@hourlycommit-on=@hourlyNote:It does not contain a[config]section.The section is called[repo].It does not contain the repositorypath.Outside of that, the settings are exactly the same.You can use the following command to initialize a basic.gronyfile with default settings in a repository root:>gronyinit/sources/my-projectOverriding.gronysettingsYou can have settings for a repo defined both in the.gronyfile and in yourgrony.conf.Both settings will be merged at run time and any setting present ingrony.confwill overridethe one in the.gronyfile.This is useful to override some settings on a per-machine basis, like the commit message, for example.Updating settingsYou can update any setting in any moment. grony will reload all files periodically to update the scheduled tasks.Note: this interval can be user-defined ingrony start(see below).More infoJust use the integrated help for the rest of the commands. It's pretty self-explanatory.Usage: grony [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  add     Adds a repository to the grony.conf file.
  init    Initializes a .grony file in the specified path.
  list    List all configured repositories.
  remove  Removes a repository from the grony.conf file.
  show    Show the effeective settings for a repository.
  start   Starts the main process.