added versioning script

master
Peter Babič 9 years ago
parent bf072929ff
commit e4f29d55bd
  1. 47
      version.sh

@ -0,0 +1,47 @@
#!/bin/bash
# get the second character of the version, so it can be incremented
lastTag=$(git describe --abbrev=0 --tags)
lastNum=${lastTag:1:1}
nextNum=$((lastNum + 1))
nextTag="v$nextNum"
prefix="tukethesis"
nextFil="$prefix-$nextTag"
remote="http://ktpe.fei.tuke.sk/vince/studenti/babic/index.php"
logFile="version.log"
#echo "releasing version: $nextTag"
#echo "----------------------"
#echo ""
# generate the log from git data
{
git diff --stat "$lastTag" HEAD | tail -1
echo ""
git log "$lastTag"..HEAD --pretty=oneline --abbrev-commit --reverse
} | tee "$nextFil.log"
# copy PDF output as a versioned file
cp "$prefix.pdf" "$nextFil.pdf"
echo ""
echo "-------------------------------------------"
echo ""
# upload the new version of PDF and a log to the Mr.Vince's remote server
{
curl -include --form "file=@tukethesis-v3.log" "$remote"
curl -include --form "file=@tukethesis-v3.pdf" "$remote"
} > "$logFile"
#echo "Files uploaded to remote host."
#echo ""
# clear the files
rm *-"$nextTag".*
# tag the version now and push it to the origin repo
git tag "$nextTag" -m "$@"
git push -u --tags origin master
Loading…
Cancel
Save