App::GitHooks::Plugin::ForceRegularUpdate - Force running a specific tool at regular intervals.
# TODO: description of how to write a tool that generates the timestamp file.
Version 1.0.5
This plugin supports the following options in the [BlockProductionCommits] section of your .githooksrc file.
[BlockProductionCommits]
.githooksrc
[BlockProductionCommits] max_update_age = 2 * 24 * 3600 # 2 days description = ./my_updater.sh env_variable = my_environment env_safe_regex = /^development$/ update_file = /var/local/.last_update.txt
This indicates the maximum amount of time that may have elapsed since the last update, before commits are blocked.
max_update_age = 2 * 24 * 3600 # 2 days
Note that this configuration option supports comments at the end, for readability.
The name of the tool to run to perform an update that will reset the time counter.
description = ./my_updater.sh
Optional, the name of the environment variable to use to determine the environment (production, staging, development, etc).
env_variable = my_environment
Optional, but required if env_variable is used.
env_variable
A regular expression that indicates that this plugin should be run when it is matched.
env_safe_regex = /^development$/
The example above only checks for regular updates when $ENV{'my_environment'} =~ /^development$/.
$ENV{'my_environment'} =~ /^development$/
The path to the file that stores the unix time of the last upgrade. This is the file your update tool should write the current unix time to upon successful completion.
update_file = /var/local/.last_update.txt
Note that you can use an absolute path, or a relative path. If relative, the path will be relative to the root of the current git repository.
Code to execute as part of the pre-commit hook.
my $success = App::GitHooks::Plugin::ForceRegularUpdate->run_pre_commit();
Please report any bugs or feature requests through the web interface at https://github.com/guillaumeaubert/App-GitHooks-Plugin-ForceRegularUpdate/issues/new. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc App::GitHooks::Plugin::ForceRegularUpdate
You can also look for information at:
GitHub's request tracker
https://github.com/guillaumeaubert/App-GitHooks-Plugin-ForceRegularUpdate/issues
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/app-githooks-plugin-forceregularupdate
CPAN Ratings
http://cpanratings.perl.org/d/app-githooks-plugin-forceregularupdate
MetaCPAN
https://metacpan.org/release/App-GitHooks-Plugin-ForceRegularUpdate
Guillaume Aubert, <aubertg at cpan.org>.
<aubertg at cpan.org>
Copyright 2013-2016 Guillaume Aubert.
This code is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for more details.
To install App::GitHooks::Plugin::ForceRegularUpdate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::GitHooks::Plugin::ForceRegularUpdate
CPAN shell
perl -MCPAN -e shell install App::GitHooks::Plugin::ForceRegularUpdate
For more information on module installation, please visit the detailed CPAN module installation guide.