[pkg-perl-tools] 01/02: dpt-salsa: add createrepo method

gregor herrmann gregoa at debian.org
Sun Jan 28 01:44:05 UTC 2018


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository pkg-perl-tools.

commit a8cac893d03c673be5629ba24386c7bbdce1e7fb
Author: gregor herrmann <gregoa at debian.org>
Date:   Sun Jan 28 02:42:03 2018 +0100

    dpt-salsa: add createrepo method
    
    Gbp-Dch: Ignore
---
 scripts/salsa | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/scripts/salsa b/scripts/salsa
index bed84a1..be423d5 100755
--- a/scripts/salsa
+++ b/scripts/salsa
@@ -100,6 +100,8 @@ if ( $command eq 'version' ) {
     or $command eq 'lsrepo' )
 {
     listrepos();
+} elsif ( $command eq 'createrepo' ) {
+    createrepo();
 } elsif ( $command eq 'help' ) {
     pod2usage(1);
 } elsif ( $command eq 'XXX' ) {
@@ -192,6 +194,45 @@ sub listrepos {
     }
 }
 
+# createrepo
+sub createrepo {
+    my ($reponame) = @args;
+    die 'Required parameter repositoryname missing.' unless $reponame;
+
+    my $repo = $api->create_project(
+        {   name         => $reponame,
+            namespace_id => $config{'perl_team_modules_packages_id'},
+            description  => "Debian package $reponame",
+            visibility   => 'public',
+        }
+    );
+    my $repoid = $repo->{id};
+
+    # webhooks: tagepending
+    $api->create_project_hook(
+        $repoid,
+        {   url => "https://webhook.salsa.debian.org/tagpending/$reponame",
+            push_events => 1,
+        }
+    );
+
+    # services: emails-on-push, irker
+    $api->edit_project_service( $repoid, 'emails-on-push',
+        { recipients => 'pkg-perl-cvs-commits at lists.alioth.debian.org' } );
+    $api->edit_project_service(
+        $repoid, 'irker',
+        {
+
+            server_host       => 'ruprecht.snow-crash.org',
+            server_port       => '6659',
+            default_irc_uri   => 'irc://irc.oftc.net:6667/',
+            recipients        => 'debian-perl',
+            colorize_messages => 1,
+
+        }
+    );
+}
+
 # helper functions
 ## prettyjson($data)
 sub prettyjson {
@@ -245,6 +286,22 @@ B<dpt-salsa> for the first time.
 
 =head2 for managing repositories
 
+=head3 I<createrepo> I<repositoryname>
+
+Creates a new repository in the I<modules> subgroup and sets up the default
+webhooks and services.
+
+Parameters:
+
+=over
+
+=item repositoryname
+
+Name of the repository to be added; usually the package name.
+Required.
+
+=back
+
 =head3 I<listrepos>
 
 Show all repos in the I<modules> subgroup.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git



More information about the Pkg-perl-cvs-commits mailing list