Add github.cgi to the central reverse proxy repo

This commit is contained in:
Generic Wiki User
2024-01-24 17:00:16 +00:00
parent df96d48749
commit 81ce04a41a
2 changed files with 21 additions and 20 deletions
@@ -0,0 +1,20 @@
#!/bin/bash
echo "
"
BODY=$( cat )
echo "${BODY}" >/tmp/github-hook-body
REF=$( echo "${BODY}" | jq -r '.ref' )
PUSHER=$( echo "${BODY}" | jq -r '.pusher.email' )
logger -t github-cgi "ref ia $REF, pusher was $PUSHER"
# For testing:
#if [ "${PUSHER}" = "axel.uhl@sap.com" -a "${REF}" = "refs/heads/translation" ]; then
if [ "${PUSHER}" = "tmsatsls+github.tools.sap_service-tip-git@sap.com" -a "${REF}" = "refs/heads/translation" ]; then
echo "Identified a push to refs/heads/translation by ${PUSHER}."
echo "Fetching translation branch from github.tools.sap and pushing it to ssh://trac@sapsailing.com/home/trac/git"
logger -t github-cgi "fetching translation branch from github.tools.sap and pushing it to ssh://trac@sapsailing.com/home/trac/git"
cd /home/wiki/gitwiki
sudo -u wiki git fetch sapsailing translation:translation 2>&1
sudo -u wiki git push origin translation:translation 2>&1
else
echo "Either pusher was not tmsatsls+github.tools.sap_service-tip-git@sap.com or ref was not refs/heads/translation. Not triggering."
fi
-20
View File
@@ -1,20 +0,0 @@
#!/bin/bash
echo "
"
BODY=$( cat )
echo "${BODY}" >/tmp/github-hook-body
REF=$( echo "${BODY}" | jq -r '.ref' )
PUSHER=$( echo "${BODY}" | jq -r '.pusher.email' )
logger -t github-cgi "ref ia $REF, pusher was $PUSHER"
# For testing:
#if [ "${PUSHER}" = "axel.uhl@sap.com" -a "${REF}" = "refs/heads/translation" ]; then
if [ "${PUSHER}" = "tmsatsls+github.tools.sap_service-tip-git@sap.com" -a "${REF}" = "refs/heads/translation" ]; then
echo "Identified a push to refs/heads/translation by ${PUSHER}."
echo "Fetching translation branch from github.tools.sap and pushing it to ssh://trac@sapsailing.com/home/trac/git"
logger -t github-cgi "fetching translation branch from github.tools.sap and pushing it to ssh://trac@sapsailing.com/home/trac/git"
cd /home/wiki/gitwiki
sudo -u wiki git fetch sapsailing translation:translation 2>&1
sudo -u wiki git push origin translation:translation 2>&1
else
echo "Either pusher was not tmsatsls+github.tools.sap_service-tip-git@sap.com or ref was not refs/heads/translation. Not triggering."
fi
+1
View File
@@ -0,0 +1 @@
../../environments_scripts/central_reverse_proxy/files/var/www/cgi-bin/github.cgi