You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.1 KiB
48 lines
1.1 KiB
9 years ago
|
#!/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
|
||
|
|