Page MenuHomec4science

test_repo.sh
No OneTemporary

File Metadata

Created
Thu, May 9, 12:12

test_repo.sh

#!/bin/bash -e
WORKDIR='/tmp'
LOGFILE='/tmp/test_repo.log'
error() {
cat $LOGFILE | mail -s "Error $1" jean-baptiste.aubort@epfl.ch
}
clean() {
rm -fr $WORKDIR/PHTEST
}
test_clone() {
cd $WORKDIR
git clone ssh://git@c4science.ch/source/phtest.git PHTEST
cd PHTEST
git config user.name 'c4science bot'
git config user.email 'bot@c4science.ch'
}
test_push() {
cd $WORKDIR/PHTEST
echo test >> README.md
git add README.md
git commit -m "Testing..."
git push origin master
}
exec 2>> $LOGFILE
date >> $LOGFILE
clean
test_clone || error clone
test_push || error push

Event Timeline