recreate the full config everytime

This commit is contained in:
echtnurich 2024-08-07 18:51:12 +02:00
parent 149f846d32
commit 3b83a5d8ab
Signed by: echtnurich
SSH key fingerprint: SHA256:1eIkxME0VPeXC2WMl9Haus+q0SLFymSAWU7f6Z+A8Aw

View file

@ -34,18 +34,14 @@
wantedBy = [ "default.target" ];
requiredBy = [ "network.target" ];
preStart = "echo \"\n\" >> /run/secrets/git_clone_key
if ! [ -d \"/var/lib/yate/.git\" ]
then
rm -rf /var/lib/yate/*
rm -rf /var/lib/yate/.*
${pkgs.git}/bin/git init /var/lib/yate
${pkgs.git}/bin/git -C /var/lib/yate remote add origin forgejo@git.hamburg.ccc.de:echtnurich/yate-config.git
env GIT_SSH_COMMAND=\"${pkgs.openssh}/bin/ssh -i /run/secrets/git_clone_key\" ${pkgs.git}/bin/git -C /var/lib/yate pull -f --set-upstream
${pkgs.git}/bin/git -C /var/lib/yate checkout --track -f origin/master
echo \"New repo set up.\"
fi
test ${pkgs.openssh}/bin/ssh
${pkgs.git}/bin/git -C /var/lib/yate config --add safe.directory \"/var/lib/yate\"
${pkgs.git}/bin/git -C /var/lib/yate remote add origin forgejo@git.hamburg.ccc.de:echtnurich/yate-config.git
env GIT_SSH_COMMAND=\"${pkgs.openssh}/bin/ssh -i /run/secrets/git_clone_key\" ${pkgs.git}/bin/git -C /var/lib/yate fetch --all
${pkgs.git}/bin/git -C /var/lib/yate checkout -f origin/master";
${pkgs.git}/bin/git -C /var/lib/yate checkout --track -f origin/master";
# ...
};
}