File: ref-updated

package info (click to toggle)
grokmirror 1.0.0-1.1~deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 296 kB
  • sloc: python: 1,792; sh: 24; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Gerrit's hook system is very different from standard git, so
# minor modifications to the hook are required to make it work.
# Place this file in your gerrit/hooks/ref-updated and modify the
# variables below to make it work for you.

GERRIT_HOME=/var/lib/gerrit
GERRIT_GIT=/srv/gerrit/git

GROK_MANIFEST_BIN=/usr/bin/grok-manifest
GROK_MANIFEST_LOG=${GERRIT_HOME}/logs/grok-manifest.log
# You'll need to place this where you can serve it with httpd
# Make sure the gerrit process can write to this location
GROK_MANIFEST=/var/www/html/grokmirror/manifest.js.gz

# Yank out the project out of the passed params
args=$(getopt -l "project:" -- "$@")

eval set -- "$args"
while [ $# -ge 1 ]; do
    case "$1" in
        --)
            # No more options left.
            shift
            break
            ;;
        --project)
            project="$2"
            shift
            ;;
    esac
    shift
done

${GROK_MANIFEST_BIN} -y -w -l ${GROK_MANIFEST_LOG} \
    -m ${GROK_MANIFEST} \
    -t ${GERRIT_GIT} \
    -n "${GERRIT_GIT}/${project}.git"