File size: 271 Bytes
8dba997
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

log() {
  echo "$(date +'%Y-%m-%d %H:%M:%S') $1" 
}

while true 
do
  log "Pushing git repository..."  
  git push
  if [ $? -eq 0 ]; then
    log "Git push succeeded."
    break
  else
    log "Git push failed, retrying in 5 seconds."  
  fi
  sleep 5
done