Programming/기본 (Baisc)

[Git][깃][자동 push][Git push] Git 자동 Push

1. 개요

 git을 구성하다보면 SSH로 자동화 하는 케이스도 있지만, 계정을 통해 부득이하게 Git push를 해야하는 경우도 존재한다.

 이를 조금 더 효율적이고 많은 Git Repository를 구성하기 위해 다음과 같이 개발한다.

 

2. 조치

#!/bin/bash

gitList=( `find /data/yona/repo/git -name *.git -type d` )

echo "Start -- Git List"

function nowdate() {
    echo `date "+%Y-%m-%d"`
}

while true
do
    for gitDir in "${gitList[@]}"; 
    do 
        NOW_DATE=`nowdate`
        nohup echo "Git Push -- ${gitDir}" >> /applog/git/console.log.${NOW_DATE}; \
        cd "$gitDir"; \
        /app/monitor/git_push_all "${gitDir}" 2>&1 >> /applog/git/console.log.${NOW_DATE} &
        sleep 0.1
    done
    sleep 30
done

 

사업자 정보 표시
디알소프트 | 유용훈 | 서울시 양천구 오목로 30길 | 사업자 등록번호 : 184-47-00657 | TEL : 02-2692-1002 | Mail : gkioo@daum.net | 통신판매신고번호 : 호 | 사이버몰의 이용약관 바로가기