2020-07-24 20:53:20 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
{% for git_repo in git_repositories %}
|
|
|
|
if [ ! -d {{ backup_folder }}/{{ backup_user_git }}/{{ git_repo | basename }} ]; then
|
|
|
|
cd {{ backup_folder }}/{{ backup_user_git }}
|
|
|
|
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone --mirror {{ git_repo }}
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd {{ backup_folder }}/{{ backup_user_git }}/{{ git_repo | basename }}
|
|
|
|
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git remote update
|
|
|
|
|
|
|
|
if [ ! -d {{ backup_folder }}/{{ backup_user_git }}/{{ (git_repo | basename | splitext)[0] }} ]; then
|
|
|
|
cd {{ backup_folder }}/{{ backup_user_git }}
|
|
|
|
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone {{ git_repo }}
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd {{ backup_folder }}/{{ backup_user_git }}/{{ (git_repo | basename | splitext)[0] }}
|
|
|
|
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git fetch --all
|
2020-07-25 07:30:17 +02:00
|
|
|
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git pull
|
2020-07-24 20:53:20 +02:00
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
|