[sysadmin-bin] Make sure kgb only fires for official projects



commit 0faccd6e74d06f2ae5ef3a9aacd72a5608f25c3e
Author: Andrea Veri <averi redhat com>
Date:   Tue Sep 12 16:32:57 2017 +0200

    Make sure kgb only fires for official projects

 git/post-receive-notify-kgb |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/git/post-receive-notify-kgb b/git/post-receive-notify-kgb
index 729ac35..51c322c 100755
--- a/git/post-receive-notify-kgb
+++ b/git/post-receive-notify-kgb
@@ -2,7 +2,12 @@
 # actually match the repository-name you are going to configure on kgb.conf and kgb-client.conf. More
 # details at https://wiki.gnome.org/Sysadmin/CommitsBot. KGB will only notify commits made to the master 
branch.
 
+GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
+ABSDIR=$(cd $GIT_DIR && pwd)
+BASEDIR=$(dirname $ABSDIR)
 REPOSITORY_ID=$(basename "$PWD")
 REPOSITORY_ID=${REPOSITORY_ID%.git}
 
-grep -v refs/heads/wip | kgb-client --conf /home/admin/KGB/kgb-client-$REPOSITORY_ID.conf --repository git 
--git-reflog - > /dev/null 2>&1
+if [[ $BASEDIR = '/var/opt/gitlab/git-data/repositories/GNOME' || $BASEDIR = '/git' ]]; then
+      grep -v refs/heads/wip | kgb-client --conf /home/admin/KGB/kgb-client-$REPOSITORY_ID.conf --repository 
git --git-reflog - > /dev/null 2>&1
+fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]