-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate-github.sh
executable file
·45 lines (35 loc) · 1.17 KB
/
update-github.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
echo Executing $0
# specify working directories
PROJECTDIR=/home/megmethods/roboos
FIELDTRIPDIR=$PROJECTDIR/fieldtrip/fieldtrip
FILEIODIR=$PROJECTDIR/fieldtrip/fileio
QSUBDIR=$PROJECTDIR/fieldtrip/qsub
LOGFILE=$PROJECTDIR/fieldtrip/github.log
# get all changes from the master branch on github
cd $FIELDTRIPDIR || exit
git checkout master
git pull upstream master
# synchronize identical files
# if there are no changes, this will give "nothing to commit, working directory clean"
REV=`git log -n 1 --pretty=format:"%H"`
$FIELDTRIPDIR/bin/synchronize-private.sh
git commit -a -m "automatically synchronized identical files to $REV"
git push upstream master
# also push to bitbucket
git push bitbucket master
# also push to gitlab
git push gitlab master
# synchronize the fileio repository
cd $FILEIODIR || exit
rsync -arp --delete --exclude '.git' $FIELDTRIPDIR/fileio/* .
git add .
git commit -am "synchronized with main FieldTrip repository"
git push
# synchronize the qsub repository
cd $QSUBDIR || exit
rsync -arp --delete --exclude '.git' $FIELDTRIPDIR/qsub/* .
git add .
git commit -am "synchronized with main FieldTrip repository"
git push
date > $LOGFILE