forked from ruby/git.ruby-lang.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost-receive.sh
executable file
·45 lines (33 loc) · 1.36 KB
/
post-receive.sh
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
39
40
41
42
43
44
45
#!/bin/bash -u
set -o pipefail
# This script is executed by `git@git.ruby-lang.org:ruby.git/hooks/post-receive`.
# Its outputs are logged to `/tmp/post-receive.log`.
# script parameters
ruby_git="/var/git/ruby.git"
ruby_commit_hook="$(cd "$(dirname $0)"; cd ..; pwd)"
# Cancel impact of SSH Agent Forwarding to git push by matzbot
unset SSH_AUTH_SOCK
function log() {
echo -e "[$$: $(date "+%Y-%m-%d %H:%M:%S %Z")] $1"
}
log "### start ###"
log "SVN_ACCOUNT_NAME: ${SVN_ACCOUNT_NAME:-}"
log "args: $*"
log "==> notify slack"
"${ruby_commit_hook}/bin/notify-slack-commits.rb" $*
log "==> commit-email.rb"
"${ruby_commit_hook}/bin/commit-email.rb" \
"$ruby_git" ruby-cvs@ruby-lang.org $* \
--viewer-uri "https://github.com/ruby/ruby/commit/" \
--error-to cvs-admin@ruby-lang.org
log "==> redmine fetch changesets"
curl -s "https://bugs.ruby-lang.org/sys/fetch_changesets?key=`cat ~git/config/redmine.key`" &
# Make extra commits from here.
# The above procedure will be executed for the these commits in another post-receive hook.
log "==> auto-style"
SVN_ACCOUNT_NAME=git "${ruby_commit_hook}/bin/auto-style.rb" "$ruby_git" $*
log "==> update-version.h"
SVN_ACCOUNT_NAME=git "${ruby_commit_hook}/bin/update-version.h.rb" git "$ruby_git" $*
log "==> notes-github-pr"
SVN_ACCOUNT_NAME=git "${ruby_commit_hook}/bin/notes-github-pr.rb" "$ruby_git" $*
log "### end ###\n"