Subject: | Add support for GPG signed tags with Git |
The following changes since commit b741ca642f7b128dc223f36c194423c35776ca7a:
Kenichi Ishigaki (1):
remove trailing spaces (most probably cr/lfs left intact by binmode)
are available in the git repository at:
git://github.com/jhelwig/shipit.git support-signed-git-tags
Jacob Helwig (1):
Add support for GPG signed release tags.
lib/ShipIt/VC/Git.pm | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/ShipIt/VC/Git.pm b/lib/ShipIt/VC/Git.pm
index 9e90715..b7ac24b 100644
--- a/lib/ShipIt/VC/Git.pm
+++ b/lib/ShipIt/VC/Git.pm
@@ -9,6 +9,7 @@ sub new {
my ($class, $conf) = @_;
my $self = bless {}, $class;
$self->{tagpattern} = $conf->value( $self->command . ".tagpattern" );
+ $self->{sign_tag} = $conf->value( $self->command . ".sign_tag" );
$self->{push_to} = $conf->value( $self->command . ".push_to" );
return $self;
}
@@ -27,6 +28,11 @@ In your .shipit configuration file, the following options are recognized:
Defines how the tag are defined in your git repo.
+=item B<git.sign_tag>
+
+This should be set to a truthy value, if you wish the tags to be GPG signed.
+(C<git tag -s ...>)
+
=item B<git.push_to>
If you want the newly created to be pushed elsewhere (for instance in your
@@ -103,8 +109,7 @@ sub tag_version {
print $tmp_fh $msg;
my $tmp_fn = "$tmp_fh";
my $tag = $self->_tag_of_version($ver);
- ## not GPG signed
- system($self->command, "tag", "-a", "-F", $tmp_fn, $tag)
+ system($self->command, "tag", "-a", ($self->{sign_tag} ? "-s" : ()), "-F", $tmp_fn, $tag)
and die "Tagging of version '$ver' failed.\n";
if (my $where = $self->{push_to}) {
@@ -121,5 +126,3 @@ sub are_local_diffs {
}
1;
-
-