diff --git a/scripts/sync_gitea_to_github.sh b/scripts/sync_gitea_to_github.sh index afc54fe..545bf94 100755 --- a/scripts/sync_gitea_to_github.sh +++ b/scripts/sync_gitea_to_github.sh @@ -3,25 +3,26 @@ # Nastavení proměnných GITEA_REPO="ssh://git@git.arch-linux.cz:29418/Archos/prehlad-financi-komunity.git" GITHUB_REPO="git@github.com:zkreml/prehlad-financi-komunity.git" -TMP_DIR=$(mktemp -d) -LOG_FILE="/path/to/your/automation-scripts/logs/sync_gitea_to_github.log" +REPO_DIR="/home/archos/git_archlinuxcz/prehlad-financi-komunity" +LOG_DIR="/home/archos/git_archlinuxcz/automation-scripts/logs" +LOG_FILE="$LOG_DIR/sync_gitea_to_github.log" # Funkce pro logování log() { echo "$(date) - $1" >> $LOG_FILE } -# Klonování Gitea repozitáře -log "Klonování Gitea repozitáře" -git clone --mirror $GITEA_REPO $TMP_DIR +# Vytvoření adresáře pro logy, pokud neexistuje +mkdir -p $LOG_DIR + +# Pull změn z Gitea repozitáře +log "Pull změn z Gitea repozitáře" +cd $REPO_DIR +git pull $GITEA_REPO # Pushing to GitHub log "Pushing to GitHub" -cd $TMP_DIR -git push --mirror $GITHUB_REPO - -# Úklid -log "Úklid" -rm -rf $TMP_DIR +git push $GITHUB_REPO log "Synchronizace dokončena" +