taddrepo.sh script - scripts - random scripts
 (HTM) git clone git://parazyd.org/scripts.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit 7bfcd172c20bcb93d555a1f4ee9416cb53aa21fc
 (DIR) parent 05e11c89f3d75626468a745ab2716242c63f6f32
 (HTM) Author: parazyd <parazyd@dyne.org>
       Date:   Thu, 16 Jun 2016 17:51:41 +0200
       
       addrepo.sh script
       
       Diffstat:
         A addrepo.sh                          |      35 +++++++++++++++++++++++++++++++
       
       1 file changed, 35 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/addrepo.sh b/addrepo.sh
       t@@ -0,0 +1,35 @@
       +#!/bin/sh
       +#
       +# parazyd - (c) wtfpl 2016
       +# add a repository to gitolite conf and push
       +
       +GITOLITE="~/devel/gitolite-admin"
       +
       +reponame="$1"
       +repodesc="$2"
       +repoowner=`awk '/name =/ {print $3}' ~/.gitconfig`
       +[[ -n $3 ]] && repoowner="$3"
       +
       +
       +writeconf() {
       +        cat <<EOF
       +repo $reponame
       +        RW+                =        $repoowner
       +        R                =        gitweb
       +        config core.sharedRepository = true
       +        config gitweb.description = "${repodesc}"
       +        config gitweb.owner = "${repoowner}"
       +
       +EOF
       +}
       +
       +if [[ -n $reponame ]] && [[ -n $repodesc ]]; then
       +        cd $GITOLITE
       +        writeconf >> conf/gitolite.conf
       +        git commit conf/gitolite.conf -m "added $reponame repository"
       +        git push
       +        cd -
       +else
       +        echo "usage: `basename $0` [repo name] [repo description] [repo owner]"
       +fi
       +