Das würde mich auch interessieren.
Ich denke mal du verwendest ja Gitlab und nicht nur einen Git-Server als solchen?!
Ich weiß nicht ob Github da über die API noch etwas mehr zur Verfügung stellt
Aber da kann das Symcon-Team bestimmt mal für Klarheit sorgen
Also ich betreibe meinen GIT Server auf einen Rasberry Pi im Dockersystem
Habe mal für euch die 4 Files mit angehängt gelegt
vielleicht könnt ihr damit was anfangen
Also dann werde ich mal schauen wo ich einen Fehler in der Configuaton gemacht habe.
Aber wenn Ihr schneller seit währe ich über euer Antwort dankbar
Gruß
Black-Blade
Hier die Configs
Apache
<VirtualHost *:80>
DocumentRoot /usr/share/gitweb
SetEnv GITWEB_CONFIG /etc/git/gitweb.conf
Alias /gitweb.css /usr/share/gitweb/gitweb.css
Alias /gitweb.js /usr/share/gitweb/gitweb.js
Alias /git-favicon.png /usr/share/gitweb/git-favicon.png
Alias /git-logo.png /usr/share/gitweb/git-logo.png
ScriptAlias /gitweb.cgi /usr/lib/cgi-bin/gitweb.cgi
DirectoryIndex gitweb.cgi
<Directory /usr/lib/cgi-bin/>
AuthType Basic
AuthName "GIT Repository"
AuthUserFile /dav_svn.passwd
Require valid-user
</Directory>
Alias /git "/git"
<Directory /git>
# AuthType Basic
# AuthName "GIT Repository"
# AuthUserFile /dav_svn.passwd
# Require valid-user
Dav On
Require all granted
Options +Indexes
</Directory>
</VirtualHost>
gitweb
# path to git projects (<project>.git)
$projectroot = "/git";
# directory to use for temp files
$git_temp = "/tmp";
# target of the home link on top of all pages
#$home_link = $my_uri || "/";
# html text to include at home page
#$home_text = "indextext.html";
# file with project list; by default, simply scan the projectroot dir.
#$projects_list = $projectroot;
# stylesheet to use
#@stylesheets = ("static/gitweb.css");
# javascript code for gitweb
#$javascript = "static/gitweb.js";
# logo to use
#$logo = "static/git-logo.png";
# the 'favicon'
#$favicon = "static/git-favicon.png";
# git-diff-tree(1) options to use for generated patches
#@diff_opts = ("-M");
@diff_opts = ();
make.sh
##!/bin/bash
# Config Contenername and Image
CONTENERNAME="git_"$(date +%e"-"%m"-"%y"."%H"."%M"."%S)
#IMAGE name from https://hub.docker.com
#IMAGE="my_debian:latest"
IMAGE="debian:stretch"
# Default of directory you run this from, update to where ever.
PW="$(pwd)"
CONFIGS="${PW}/data"
echo -n "install ${CONTENERNAME} by Image ${IMAGE}"
#docker pull ${IMAGE}
docker run -d \
--name "${CONTENERNAME}" \
--cap-add=NET_ADMIN \
-p 9005:80/tcp \
-v "${CONFIGS}/iptables/:/etc/iptables/" \
-v "${CONFIGS}/hosts/:/etc/myhosts" \
-v "${CONFIGS}/git:/git" \
-v "${CONFIGS}/config/apache2:/etc/apache2/" \
-v "${CONFIGS}/config/git:/etc/git/" \
-e TZ="Europe/Berlin" \
--dns x.x.x.x \
--net datanet \
--ip x.x.x.x\
--restart=unless-stopped \
-w "/bin" \
${IMAGE} \
bash -c "/start.sh"
docker cp start.sh ${CONTENERNAME}:/start.sh
docker cp dav_svn.passwd ${CONTENERNAME}:/dav_svn.passwd
docker container restart ${CONTENERNAME}
echo "Wait for finsch to make the contener"
while true;
do
aa=$(docker exec ${CONTENERNAME} cat /install 2> /dev/null | wc -l)
if [[ "$aa" == 1 ]];
then
break
else
echo -n "."
sleep 1
fi
done
echo "finish ${CONTENERNAME}"
start.sh
#!/bin/bash
function install {
if [ ! -f "/install" ];
then
apt-get update
apt-get -s dist-upgrade
apt-get -y install net-tools htop dnsutils iptables nano curl
apt-get -y install apache2 apache2-utils
apt-get -y install git gitweb wget
rm /etc/gitweb.conf
a2enmod cgi
a2enmod dav
a2enmod dav_fs
echo 'install' > "/install"
fi
}
function setup_signals {
cid="$1"; shift
handler="$1"; shift
for sig; do
trap "$handler '$cid' '$sig'" "$sig"
done
}
function handle_signal {
echo "[docker-exec] received $2"
case "$2" in
SIGINT)
echo "[apache2 stop]"
service apache2 stop
running=0
;;
SIGTERM)
echo "[apache2 stop]"
service apache2 stop
running=0
;;
SIGHUP)
echo "[apache2 restart]"
service apache2 restart
;;
esac
}
echo "[contener start]"
running=1
setup_signals "$1" "handle_signal" SIGINT SIGTERM SIGHUP
echo "nameserver x,x,x,x" > /etc/resolv.conf
echo "nameserver x.x.x.x" >> /etc/resolv.conf
echo "[set hosts]"
cat /etc/myhosts/hosts | while read line; do echo $line >> /etc/hosts; done
echo "[set timezone"]
echo "Europe/Berlin" > /etc/timezone
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
echo "[set iptables]"
/etc/iptables/iptables.sh
echo "[stat apache2]"
install
service apache2 start
tail -f /var/log/apache2/error.log &
tail -f /var/log/apache2/access.log &
while true; do
if [ "$running" = "1" ]; then
sleep 1
else
echo "[wait for finsch apache2]"
break
fi
done
while [ 1 ]
do
pid=$(ps -C "apache2" -o pid=)
if [ -z "$pid" ]
then
break
fi
sleep 2
echo "[wait for finsch apache2]"
done
echo "[contener stop]"